git://git.onelab.eu
/
build.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
module-tools & git clone : specify --depth only when necessary
[build.git]
/
module-tools.py
diff --git
a/module-tools.py
b/module-tools.py
index
58f7b85
..
aed29e3
100755
(executable)
--- a/
module-tools.py
+++ b/
module-tools.py
@@
-280,9
+280,10
@@
class GitRepository:
return line.split()[2]
@classmethod
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("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
return GitRepository(local, options)
@classmethod