1 |
On 01/17/2015 04:28 AM, Michał Górny wrote: |
2 |
> Discard the git-rev-parse error output to avoid 'fatal: Not a git |
3 |
> repository [...]' errors when checking whether the repository exists. |
4 |
> --- |
5 |
> pym/portage/sync/modules/git/git.py | 2 +- |
6 |
> 1 file changed, 1 insertion(+), 1 deletion(-) |
7 |
> |
8 |
> diff --git a/pym/portage/sync/modules/git/git.py b/pym/portage/sync/modules/git/git.py |
9 |
> index b97d501..02da037 100644 |
10 |
> --- a/pym/portage/sync/modules/git/git.py |
11 |
> +++ b/pym/portage/sync/modules/git/git.py |
12 |
> @@ -36,7 +36,7 @@ class GitSync(SyncBase): |
13 |
> |
14 |
> if not os.path.exists(self.repo.location): |
15 |
> return False |
16 |
> - exitcode = portage.process.spawn_bash("cd %s ; git rev-parse" %\ |
17 |
> + exitcode = portage.process.spawn_bash("cd %s ; git rev-parse 2>/dev/null" %\ |
18 |
> (portage._shell_quote(self.repo.location),), |
19 |
> **portage._native_kwargs(self.spawn_kwargs)) |
20 |
> if exitcode == 128: |
21 |
> |
22 |
|
23 |
Why don't we just skip the git rev-parse call entirely, if not |
24 |
os.path.isdir(os.path.join(self.repo.location, ".git"))? |
25 |
-- |
26 |
Thanks, |
27 |
Zac |