From: Thierry Parmentelat Date: Fri, 3 Apr 2015 08:26:59 +0000 (+0200) Subject: module-tools & git clone : specify --depth only when necessary X-Git-Tag: 5.3.8 X-Git-Url: http://git.onelab.eu/?p=build.git;a=commitdiff_plain;h=refs%2Ftags%2F5.3.8 module-tools & git clone : specify --depth only when necessary Merge branch 'master' of ssh://git.onelab.eu/git/build --- 1f91236d83fb7d5aec6ac6832ad3f6fa67c36ed9 diff --cc module-tools.py index 58f7b85f,58f7b85f..aed29e34 --- a/module-tools.py +++ b/module-tools.py @@@ -280,9 -280,9 +280,10 @@@ class GitRepository return line.split()[2] @classmethod -- def clone(cls, remote, local, options, depth=0): ++ def clone(cls, remote, local, options, depth=None): Command("rm -rf %s" % local, options).run_silent() -- Command("git clone --depth %d %s %s" % (depth, remote, local), options).run_fatal() ++ depth_option = "" if depth is None else " --depth {}".format(depth) ++ Command("git clone{} {} {}".format(depth_option, remote, local), options).run_fatal() return GitRepository(local, options) @classmethod