Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2021-05-20 13:14:33 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2021-05-20 18:29:20 +0300
commit5f67906e75f9504c7d0d2f1327b5faa92808759d (patch)
tree25e9e9ec9b690cbba35ab3b55630969fe583df8a
parent26797a702283d427892e5d8e2fb117a0285ee6e7 (diff)
Makefile: Fix targets when running make(1) in an interactive rebase
During an interactive rebase, Git sets up various environment variables which point to the repository in which the rebase is being executed. Other Git commands will pick up these envvars and will as a result operate in that same repository. This is dangerous in our case, given that we're spawning Git commands in our Makefile which we certainly want to run in a different directory. Fix the issue by unexporting these environment variables.
-rw-r--r--Makefile6
1 files changed, 6 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 08a80fd4d..ac5731c15 100644
--- a/Makefile
+++ b/Makefile
@@ -4,6 +4,12 @@
# directory.
-include config.mak
+# Unexport environment variables which have an effect on Git itself.
+# We need to keep GIT_PREFIX because it's used to determine where our
+# self-built Git should be installed into. It's probably not going to
+# matter much though.
+unexport $(filter-out GIT_PREFIX,$(shell git rev-parse --local-env-vars))
+
# Call `make V=1` in order to print commands verbosely.
ifeq ($(V),1)
Q =