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