diff options
Diffstat (limited to 'project.py')
-rw-r--r-- | project.py | 17 |
1 files changed, 7 insertions, 10 deletions
@@ -1877,6 +1877,13 @@ class Project(object): | |||
1877 | 1877 | ||
1878 | if depth: | 1878 | if depth: |
1879 | cmd.append('--depth=%s' % depth) | 1879 | cmd.append('--depth=%s' % depth) |
1880 | else: | ||
1881 | # If this repo has shallow objects, then we don't know which refs have | ||
1882 | # shallow objects or not. Tell git to unshallow all fetched refs. Don't | ||
1883 | # do this with projects that don't have shallow objects, since it is less | ||
1884 | # efficient. | ||
1885 | if os.path.exists(os.path.join(self.gitdir, 'shallow')): | ||
1886 | cmd.append('--depth=2147483647') | ||
1880 | 1887 | ||
1881 | if quiet: | 1888 | if quiet: |
1882 | cmd.append('--quiet') | 1889 | cmd.append('--quiet') |
@@ -1914,16 +1921,6 @@ class Project(object): | |||
1914 | spec.append(str((u'+%s:' % branch) + remote.ToLocal(branch))) | 1921 | spec.append(str((u'+%s:' % branch) + remote.ToLocal(branch))) |
1915 | cmd.extend(spec) | 1922 | cmd.extend(spec) |
1916 | 1923 | ||
1917 | shallowfetch = self.config.GetString('repo.shallowfetch') | ||
1918 | if shallowfetch and shallowfetch != ' '.join(spec): | ||
1919 | GitCommand(self, ['fetch', '--depth=2147483647', name] | ||
1920 | + shallowfetch.split(), | ||
1921 | bare=True, ssh_proxy=ssh_proxy).Wait() | ||
1922 | if depth: | ||
1923 | self.config.SetString('repo.shallowfetch', ' '.join(spec)) | ||
1924 | else: | ||
1925 | self.config.SetString('repo.shallowfetch', None) | ||
1926 | |||
1927 | ok = False | 1924 | ok = False |
1928 | for _i in range(2): | 1925 | for _i in range(2): |
1929 | gitcmd = GitCommand(self, cmd, bare=True, ssh_proxy=ssh_proxy) | 1926 | gitcmd = GitCommand(self, cmd, bare=True, ssh_proxy=ssh_proxy) |