summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorConley Owens <cco3@android.com>2015-01-21 11:12:46 -0800
committerDavid Pursehouse <david.pursehouse@sonymobile.com>2015-01-22 01:20:22 +0000
commitf97e8383a3b180fb5aa186f8cebc4c98d7787778 (patch)
tree22f8efcac598e4f961528c5e6373951a0a63f94b
parent497bde4de500416fb428a8cd57b9c62708349924 (diff)
downloadgit-repo-f97e8383a3b180fb5aa186f8cebc4c98d7787778.tar.gz
Use depth flag when fetching
Currently, we only use the depth flag when cloning. The result is that when new project history has merges, the entire history of the merged branch is brought in and the project becomes unshallow very quickly. --depth and clone-depth are often used to save on space, not just network load, so this seems less than ideal. This change uses --depth on every fetch (when the user has depth specified), not just the initial clone. The result is that the given project stays consistently shallow as opposed to growing over time, especially when merges are involved. Change-Id: Iac706cfdad4a555c72f9d9f1119195d38d91df12
-rw-r--r--project.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/project.py b/project.py
index 9af2d631..3a3c6a01 100644
--- a/project.py
+++ b/project.py
@@ -1815,9 +1815,7 @@ class Project(object):
1815 1815
1816 cmd = ['fetch'] 1816 cmd = ['fetch']
1817 1817
1818 # The --depth option only affects the initial fetch; after that we'll do 1818 if depth:
1819 # full fetches of changes.
1820 if depth and initial:
1821 cmd.append('--depth=%s' % depth) 1819 cmd.append('--depth=%s' % depth)
1822 1820
1823 if quiet: 1821 if quiet: