1 |
commit: f5d258656de3db54af06fbca9b8da5217d3802f4 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Sep 22 21:11:35 2016 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Sep 22 21:45:10 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=f5d25865 |
7 |
|
8 |
GitSync.update: handle git rev-list failure (bug 594822) |
9 |
|
10 |
Fixes: 84413bb1dd9d ("GitSync.update: respect sync-depth (bug 552814)") |
11 |
X-Gentoo-bug: 594822 |
12 |
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=594822 |
13 |
|
14 |
pym/portage/sync/modules/git/git.py | 14 ++++++++++---- |
15 |
1 file changed, 10 insertions(+), 4 deletions(-) |
16 |
|
17 |
diff --git a/pym/portage/sync/modules/git/git.py b/pym/portage/sync/modules/git/git.py |
18 |
index c1028ab..3734b80 100644 |
19 |
--- a/pym/portage/sync/modules/git/git.py |
20 |
+++ b/pym/portage/sync/modules/git/git.py |
21 |
@@ -90,10 +90,16 @@ class GitSync(NewBase): |
22 |
# Since the default merge strategy typically fails when |
23 |
# the depth is not unlimited, use `git fetch` followed by |
24 |
# `git reset --merge`. |
25 |
- remote_branch = portage._unicode_decode( |
26 |
- subprocess.check_output([self.bin_command, 'rev-parse', |
27 |
- '--abbrev-ref', '--symbolic-full-name', '@{upstream}'], |
28 |
- cwd=portage._unicode_encode(self.repo.location))).rstrip('\n') |
29 |
+ try: |
30 |
+ remote_branch = portage._unicode_decode( |
31 |
+ subprocess.check_output([self.bin_command, 'rev-parse', |
32 |
+ '--abbrev-ref', '--symbolic-full-name', '@{upstream}'], |
33 |
+ cwd=portage._unicode_encode(self.repo.location))).rstrip('\n') |
34 |
+ except subprocess.CalledProcessError as e: |
35 |
+ msg = "!!! git rev-parse error in %s" % self.repo.location |
36 |
+ self.logger(self.xterm_titles, msg) |
37 |
+ writemsg_level(msg + "\n", level=logging.ERROR, noiselevel=-1) |
38 |
+ return (e.returncode, False) |
39 |
|
40 |
git_cmd_opts += " --depth %d" % self.repo.sync_depth |
41 |
git_cmd = "%s fetch %s%s" % (self.bin_command, |