diff options
Diffstat (limited to 'project.py')
| -rw-r--r-- | project.py | 20 |
1 files changed, 9 insertions, 11 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) |
| @@ -2347,10 +2344,11 @@ class Project(object): | |||
| 2347 | if copy_all: | 2344 | if copy_all: |
| 2348 | to_copy = os.listdir(gitdir) | 2345 | to_copy = os.listdir(gitdir) |
| 2349 | 2346 | ||
| 2347 | dotgit = os.path.realpath(dotgit) | ||
| 2350 | for name in set(to_copy).union(to_symlink): | 2348 | for name in set(to_copy).union(to_symlink): |
| 2351 | try: | 2349 | try: |
| 2352 | src = os.path.realpath(os.path.join(gitdir, name)) | 2350 | src = os.path.realpath(os.path.join(gitdir, name)) |
| 2353 | dst = os.path.realpath(os.path.join(dotgit, name)) | 2351 | dst = os.path.join(dotgit, name) |
| 2354 | 2352 | ||
| 2355 | if os.path.lexists(dst): | 2353 | if os.path.lexists(dst): |
| 2356 | continue | 2354 | continue |
