summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-07-20 20:26:42 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-07-20 21:12:16 +0900
commit00ea3c16190861bc1395d2a04dd8588f8ae5fd31 (patch)
treea59c943cbd6b85c4294c1392b82804b7f77b729b
parent885afe8df3ddf6c4c8434820cb52fb6913007b1e (diff)
downloadbuildstream-tristan/remove-history-from-build-trees.tar.gz
git source plugin: Omit the .git directory completely.tristan/remove-history-from-build-trees
This will break builds which use `git describe` to determine their version number until a more elegant solution is implemented, and will unblock work on caching of build trees in the artifacts.
-rw-r--r--buildstream/plugins/sources/git.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/buildstream/plugins/sources/git.py b/buildstream/plugins/sources/git.py
index d079d8747..d1ea81763 100644
--- a/buildstream/plugins/sources/git.py
+++ b/buildstream/plugins/sources/git.py
@@ -163,6 +163,9 @@ class GitMirror():
fail="Failed to checkout git ref {}".format(self.ref),
cwd=fullpath)
+ # Remove .git dir
+ shutil.rmtree(os.path.join(fullpath, ".git"))
+
def init_workspace(self, directory):
fullpath = os.path.join(directory, self.path)