From a694e431decf8c05316d42a3c67a4127a0424fae Mon Sep 17 00:00:00 2001 From: jmoore Date: Wed, 29 Aug 2018 17:34:54 +0200 Subject: [PATCH] Simplify unneeded paths --- scc/git.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/scc/git.py b/scc/git.py index 9382f817..01483e59 100755 --- a/scc/git.py +++ b/scc/git.py @@ -1060,13 +1060,12 @@ def register_submodules(self): directory in self.repository_config["submodules"]: repository_config = \ self.repository_config["submodules"][directory] - # TODO: Unclear if this is needed - with self.cd(self.path): - submodule_repo = \ - self.gh.git_repo(directory, - repository_config=repository_config) - self.submodules.append(submodule_repo) - submodule_repo.register_submodules() + + submodule_repo = \ + self.gh.git_repo(directory, + repository_config=repository_config) + self.submodules.append(submodule_repo) + submodule_repo.register_submodules() def cd(self, directory): class DirectoryChanger(object): @@ -1978,9 +1977,7 @@ def rpush(self, branch_name, remote, force=False): self.dbg("Pushed %s to %s" % (branch_name, full_remote)) for submodule_repo in self.submodules: - # TODO: Unclear if needed - with self.cd(self.path): - submodule_repo.rpush(branch_name, remote, force=force) + submodule_repo.rpush(branch_name, remote, force=force) def __del__(self): # We need to make sure our logging wrappers are closed when this