[oe-commits] [bitbake] 01/10: fetch/git: Use 'git-make-shallow' from bin directory
git at git.openembedded.org
git at git.openembedded.org
Fri Feb 9 14:22:05 UTC 2018
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master-next
in repository bitbake.
commit 6b508ab8fd5aa796c1c00c970e81e5e93f84d35d
Author: Nathan Rossi <nathan at nathanrossi.com>
AuthorDate: Sat Feb 3 00:04:30 2018 +1000
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 at nathanrossi.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
lib/bb/fetch2/git.py | 5 ++++-
lib/bb/tests/fetch.py | 5 +----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index d34ea1d..35e0db5 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)
diff --git a/lib/bb/tests/fetch.py b/lib/bb/tests/fetch.py
index 11698f2..62b88f1 100644
--- a/lib/bb/tests/fetch.py
+++ b/lib/bb/tests/fetch.py
@@ -874,9 +874,6 @@ class FetchCheckStatusTest(FetcherTest):
class GitMakeShallowTest(FetcherTest):
- bitbake_dir = 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')
-
def setUp(self):
FetcherTest.setUp(self)
self.gitdir = os.path.join(self.tempdir, 'gitshallow')
@@ -905,7 +902,7 @@ class GitMakeShallowTest(FetcherTest):
def make_shallow(self, args=None):
if args is None:
args = ['HEAD']
- return bb.process.run([self.make_shallow_path] + args, cwd=self.gitdir)
+ return bb.process.run([bb.fetch2.git.Git.make_shallow_path] + args, cwd=self.gitdir)
def add_empty_file(self, path, msg=None):
if msg is None:
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list