From ffa9226b2e7b77147e6afa7f06b2491c85d356a1 Mon Sep 17 00:00:00 2001 From: Jakub Jirutka Date: Wed, 18 Nov 2015 19:04:09 +0100 Subject: [PATCH] Clone just the specified branch/tag (fixes #1) --- hererocks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hererocks.py b/hererocks.py index bd4a689..3a8f8b3 100755 --- a/hererocks.py +++ b/hererocks.py @@ -117,7 +117,8 @@ def git_clone_command(repo, ref): if all(c in string.hexdigits for c in ref): return "git clone" - return "git clone --depth=1" + # --branch works even for tags + return "git clone --depth=1 --branch=%s" % (ref or 'master') def cached_archive_name(name, version): return os.path.join(cache_path, name + version)