diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-05-20 13:14:33 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-05-20 18:29:20 +0300 |
commit | 5f67906e75f9504c7d0d2f1327b5faa92808759d (patch) | |
tree | 25e9e9ec9b690cbba35ab3b55630969fe583df8a /Makefile | |
parent | 26797a702283d427892e5d8e2fb117a0285ee6e7 (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.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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 = |