aboutsummaryrefslogtreecommitdiff
path: root/gbp/scripts/clone.py
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2012-01-12 15:25:10 +0200
committerGuido G√ľnther <agx@sigxcpu.org>2012-01-17 19:18:18 +0100
commit0c47432db776f37ceda027bf9901022df37e545d (patch)
treeb184a6ebca8062bb4efd48ce0a716499a457bf51 /gbp/scripts/clone.py
parent655050770a40607702ea478b9317634f181c06b7 (diff)
Add git-depth option to gbp-clone and gbp-pull
Allows creating and deepening shallow clones. This is sometimes useful for e.g. saving bandwidth when cloning.
Diffstat (limited to 'gbp/scripts/clone.py')
-rwxr-xr-x[-rw-r--r--]gbp/scripts/clone.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/gbp/scripts/clone.py b/gbp/scripts/clone.py
index 665b548e..2c4a93b8 100644..100755
--- a/gbp/scripts/clone.py
+++ b/gbp/scripts/clone.py
@@ -40,6 +40,8 @@ def parse_args (argv):
branch_group.add_config_file_option(option_name="upstream-branch", dest="upstream_branch")
branch_group.add_config_file_option(option_name="debian-branch", dest="debian_branch")
branch_group.add_boolean_config_file_option(option_name="pristine-tar", dest="pristine_tar")
+ branch_group.add_option("--depth", action="store", dest="depth", default=0,
+ help="git history depth (for creating shallow clones)")
parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False,
help="verbose command execution")
@@ -70,7 +72,7 @@ def main(argv):
pass
try:
- repo = GitRepository.clone(os.path.curdir, source)
+ repo = GitRepository.clone(os.path.curdir, source, options.depth)
os.chdir(repo.path)
# Reparse the config files of the cloned repository so we pick up the