aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/fetch2/git.py
diff options
context:
space:
mode:
authorNathan Rossi <nathan@nathanrossi.com>2018-02-03 00:04:30 +1000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-02-09 13:59:07 +0000
commit6b508ab8fd5aa796c1c00c970e81e5e93f84d35d (patch)
tree20f3af856fe8044ab0b760dd248aedda822dcd49 /lib/bb/fetch2/git.py
parent546a662c877b2d3af35e3996950582ed2df41fe4 (diff)
downloadbitbake-6b508ab8fd5aa796c1c00c970e81e5e93f84d35d.tar.gz
fetch/git: Use 'git-make-shallow' from bin directory
Move the code that existed in tests/fetch.py for determining the path to 'git-make-shallow' into the git module and reference it. This ensures that 'git-make-shallow' is always available and the desired version regardless of the path variable or whether git exposes the command. Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/fetch2/git.py')
-rw-r--r--lib/bb/fetch2/git.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index d34ea1de2..35e0db56c 100644
--- a/lib/bb/fetch2/git.py
+++ b/lib/bb/fetch2/git.py
@@ -125,6 +125,9 @@ class GitProgressHandler(bb.progress.LineFilterProgressHandler):
class Git(FetchMethod):
+ bitbake_dir = os.path.abspath(os.path.join(os.path.dirname(os.path.join(os.path.abspath(__file__))), '..', '..', '..'))
+ make_shallow_path = os.path.join(bitbake_dir, 'bin', 'git-make-shallow')
+
"""Class to fetch a module or modules from git repositories"""
def init(self, d):
pass
@@ -446,7 +449,7 @@ class Git(FetchMethod):
shallow_branches.append(r)
# Make the repository shallow
- shallow_cmd = ['git', 'make-shallow', '-s']
+ shallow_cmd = [self.make_shallow_path, '-s']
for b in shallow_branches:
shallow_cmd.append('-r')
shallow_cmd.append(b)