summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.van.berkom@gmail.com>2018-07-23 09:20:44 +0000
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2018-07-23 09:20:44 +0000
commitfe0df616d21395ec2a2ebb70ef79cf5d2a3c9d21 (patch)
tree159c26c1bbf9736d47f92b730ef12b09a4e878d9
parentc7124c3d49c3c7616b093b28bcd97404390644a8 (diff)
parent282b1092e78f1dbe38ada9269d825920c88cb210 (diff)
downloadbuildstream-fe0df616d21395ec2a2ebb70ef79cf5d2a3c9d21.tar.gz
Merge branch 'tristan/git-stage-with-shared-clone' into 'master'
plugins/sources/git.py: Use --shared instead of --hardlinks Closes #488 See merge request BuildStream/buildstream!557
-rw-r--r--buildstream/plugins/sources/git.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/buildstream/plugins/sources/git.py b/buildstream/plugins/sources/git.py
index d1ea81763..e68de81cf 100644
--- a/buildstream/plugins/sources/git.py
+++ b/buildstream/plugins/sources/git.py
@@ -153,10 +153,10 @@ class GitMirror():
def stage(self, directory):
fullpath = os.path.join(directory, self.path)
- # We need to pass '--no-hardlinks' because there's nothing to
- # stop the build from overwriting the files in the .git directory
- # inside the sandbox.
- self.source.call([self.source.host_git, 'clone', '--no-checkout', '--no-hardlinks', self.mirror, fullpath],
+ # Using --shared here avoids copying the objects into the checkout, in any
+ # case we're just checking out a specific commit and then removing the .git/
+ # directory.
+ self.source.call([self.source.host_git, 'clone', '--no-checkout', '--shared', self.mirror, fullpath],
fail="Failed to create git mirror {} in directory: {}".format(self.mirror, fullpath))
self.source.call([self.source.host_git, 'checkout', '--force', self.ref],