diff options
| -rw-r--r-- | project.py | 14 |
1 files changed, 13 insertions, 1 deletions
| @@ -1871,10 +1871,22 @@ class Project(object): | |||
| 1871 | 1871 | ||
| 1872 | ok = False | 1872 | ok = False |
| 1873 | for _i in range(2): | 1873 | for _i in range(2): |
| 1874 | ret = GitCommand(self, cmd, bare=True, ssh_proxy=ssh_proxy).Wait() | 1874 | gitcmd = GitCommand(self, cmd, bare=True, capture_stderr=True, |
| 1875 | ssh_proxy=ssh_proxy) | ||
| 1876 | ret = gitcmd.Wait() | ||
| 1875 | if ret == 0: | 1877 | if ret == 0: |
| 1876 | ok = True | 1878 | ok = True |
| 1877 | break | 1879 | break |
| 1880 | # If needed, run the 'git remote prune' the first time through the loop | ||
| 1881 | elif (not _i and | ||
| 1882 | "error:" in gitcmd.stderr and | ||
| 1883 | "git remote prune" in gitcmd.stderr): | ||
| 1884 | prunecmd = GitCommand(self, ['remote', 'prune', name], bare=True, | ||
| 1885 | capture_stderr=True, ssh_proxy=ssh_proxy) | ||
| 1886 | if prunecmd.Wait(): | ||
| 1887 | print(prunecmd.stderr, file=sys.stderr) | ||
| 1888 | break | ||
| 1889 | continue | ||
| 1878 | elif current_branch_only and is_sha1 and ret == 128: | 1890 | elif current_branch_only and is_sha1 and ret == 128: |
| 1879 | # Exit code 128 means "couldn't find the ref you asked for"; if we're in sha1 | 1891 | # Exit code 128 means "couldn't find the ref you asked for"; if we're in sha1 |
| 1880 | # mode, we just tried sync'ing from the upstream field; it doesn't exist, thus | 1892 | # mode, we just tried sync'ing from the upstream field; it doesn't exist, thus |
