MCPcopy Create free account
hub / github.com/Murmele/Gittyup / deinitialize

Method deinitialize

src/git/Submodule.cpp:34–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32void Submodule::initialize() const { git_submodule_init(d.data(), false); }
33
34void Submodule::deinitialize() const {
35 // Remove git config entry.
36 Repository repo(git_submodule_owner(d.data()));
37 Config config = repo.gitConfig();
38 QString regex = QString("submodule\\.%1\\..*").arg(name());
39 Config::Iterator it = config.glob(regex);
40 while (Config::Entry entry = it.next())
41 config.remove(entry.name());
42
43 // Remove submodule workdir.
44 QDir dir = repo.workdir();
45 if (dir.cd(path()) && dir.removeRecursively())
46 dir.mkpath(".");
47}
48
49QString Submodule::name() const { return git_submodule_name(d.data()); }
50

Callers 1

setDataMethod · 0.80

Calls 8

gitConfigMethod · 0.80
globMethod · 0.80
workdirMethod · 0.80
QStringClass · 0.70
dataMethod · 0.45
nextMethod · 0.45
removeMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected