aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/version
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-04-07 11:33:05 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-04-07 11:43:04 +0200
commite9f69e067da3e096e1e64be70ec2b6de30f71d2c (patch)
tree478c9f0ec86a225398424bcc9305270ca6800339 /libbuild2/version
parent5e51d523e71231cb190e9ed981962df527f4ee7e (diff)
Register environment variables for hermetic build configurations
Diffstat (limited to 'libbuild2/version')
-rw-r--r--libbuild2/version/snapshot-git.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/libbuild2/version/snapshot-git.cxx b/libbuild2/version/snapshot-git.cxx
index 8eb7cc8..28d96ac 100644
--- a/libbuild2/version/snapshot-git.cxx
+++ b/libbuild2/version/snapshot-git.cxx
@@ -37,6 +37,12 @@ namespace build2
// prevent this we pass the git's exec directory via the --exec-path
// option explicitly.
//
+ // Note also that git has quite a few GIT_* environment variables and
+ // stray values for some of them could break our commands. So it may
+ // seem like a good idea to unset them. But on the other hand, they may
+ // be there for a reason: after all, we are operating on user's projects
+ // and user's environment may be setup to handle them.
+ //
path p ("git");
process_path pp (run_search (p, true /* init */));