From f97e8383a3b180fb5aa186f8cebc4c98d7787778 Mon Sep 17 00:00:00 2001 From: Conley Owens Date: Wed, 21 Jan 2015 11:12:46 -0800 Subject: [PATCH] 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 --- project.py | 4 +--- 1 file changed, 1 insertion(+), 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): cmd = ['fetch'] - # The --depth option only affects the initial fetch; after that we'll do - # full fetches of changes. - if depth and initial: + if depth: cmd.append('--depth=%s' % depth) if quiet: