Dnia 2015-01-17, o godz. 14:07:46 Zac Medico napisał(a): > On 01/17/2015 04:28 AM, Michał Górny wrote: > > Discard the git-rev-parse error output to avoid 'fatal: Not a git > > repository [...]' errors when checking whether the repository exists. > > --- > > pym/portage/sync/modules/git/git.py | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/pym/portage/sync/modules/git/git.py b/pym/portage/sync/modules/git/git.py > > index b97d501..02da037 100644 > > --- a/pym/portage/sync/modules/git/git.py > > +++ b/pym/portage/sync/modules/git/git.py > > @@ -36,7 +36,7 @@ class GitSync(SyncBase): > > > > if not os.path.exists(self.repo.location): > > return False > > - exitcode = portage.process.spawn_bash("cd %s ; git rev-parse" %\ > > + exitcode = portage.process.spawn_bash("cd %s ; git rev-parse 2>/dev/null" %\ > > (portage._shell_quote(self.repo.location),), > > **portage._native_kwargs(self.spawn_kwargs)) > > if exitcode == 128: > > > > Why don't we just skip the git rev-parse call entirely, if not > os.path.isdir(os.path.join(self.repo.location, ".git"))? I don't know ;). I guess the current magic is more 'correct', i.e. distinguishes broken repo. Of course, it all will probably fall apart if it's broken but...! -- Best regards, Michał Górny