From 30b3f41a752cf35635affae991ee4ff11285f703 Mon Sep 17 00:00:00 2001 From: Marcus Hoffmann Date: Sun, 3 Dec 2017 14:18:18 +0100 Subject: [PATCH] GitFetchFDroidPopen: don't change cwd per default Fix for ca24aa4ca85da123df613f7105249605764f1321. For git clone we don't want to change cwd because clone actually creates the repo dir. --- fdroidserver/common.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 6b48b2a0..74e96ce8 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -796,8 +796,6 @@ class vcs_git(vcs): sticks. ''' - if cwd is None: - cwd = self.local git_config = [] for domain in ('bitbucket.org', 'github.com', 'gitlab.com'): git_config.append('-c') @@ -833,7 +831,7 @@ class vcs_git(vcs): def gotorevisionx(self, rev): if not os.path.exists(self.local): # Brand new checkout - p = self.GitFetchFDroidPopen(['clone', self.remote, self.local], cwd=None) + p = self.GitFetchFDroidPopen(['clone', self.remote, self.local]) if p.returncode != 0: self.clone_failed = True raise VCSException("Git clone failed", p.output) @@ -853,10 +851,10 @@ class vcs_git(vcs): raise VCSException(_("Git clean failed"), p.output) if not self.refreshed: # Get latest commits and tags from remote - p = self.GitFetchFDroidPopen(['fetch', 'origin']) + p = self.GitFetchFDroidPopen(['fetch', 'origin'], cwd=self.local) if p.returncode != 0: raise VCSException(_("Git fetch failed"), p.output) - p = self.GitFetchFDroidPopen(['fetch', '--prune', '--tags', 'origin'], output=False) + p = self.GitFetchFDroidPopen(['fetch', '--prune', '--tags', 'origin'], output=False, cwd=self.local) if p.returncode != 0: raise VCSException(_("Git fetch failed"), p.output) # Recreate origin/HEAD as git clone would do it, in case it disappeared @@ -899,7 +897,7 @@ class vcs_git(vcs): p = FDroidPopen(['git', 'submodule', 'sync'], cwd=self.local, output=False) if p.returncode != 0: raise VCSException(_("Git submodule sync failed"), p.output) - p = self.GitFetchFDroidPopen(['submodule', 'update', '--init', '--force', '--recursive']) + p = self.GitFetchFDroidPopen(['submodule', 'update', '--init', '--force', '--recursive'], cwd=self.local) if p.returncode != 0: raise VCSException(_("Git submodule update failed"), p.output) -- 2.30.2