X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=module-tools.py;fp=module-tools.py;h=aed29e34835ce02f1ea6b4c6672e35d392422468;hb=1f91236d83fb7d5aec6ac6832ad3f6fa67c36ed9;hp=58f7b85ffedefeb64e20cb9b644573ac86c2978c;hpb=2d2f9a66f21de60619eabf65892bf799255bec86;p=build.git diff --git a/module-tools.py b/module-tools.py index 58f7b85f..aed29e34 100755 --- a/module-tools.py +++ b/module-tools.py @@ -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