about summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authorPol Dellaiera <pol.dellaiera@protonmail.com>2023-09-25 18:40:40 +0200
committerGitHub <noreply@github.com>2023-09-25 18:40:40 +0200
commita7b3106959000630d13d7cdc6aaea7eae2fbeeb2 (patch)
tree8a1eae0ed6379b12fa33e3958ba74fa01e7cd3c8 /pkgs/build-support
parent4ddbdb0d9cf2237fdb79c2d1dad0abcf425f647f (diff)
parent7d40fbbc04cded4adbbcd3e87546d43bdacf47e8 (diff)
Merge pull request #256628 from alyssais/nix-prefetch-git-config
nix-prefetch-git: ignore global and user git config
Diffstat (limited to 'pkgs/build-support')
-rwxr-xr-xpkgs/build-support/fetchgit/nix-prefetch-git9
1 files changed, 6 insertions, 3 deletions
diff --git a/pkgs/build-support/fetchgit/nix-prefetch-git b/pkgs/build-support/fetchgit/nix-prefetch-git
index 2a53fd94e7f2b..1194b39dafd74 100755
--- a/pkgs/build-support/fetchgit/nix-prefetch-git
+++ b/pkgs/build-support/fetchgit/nix-prefetch-git
@@ -293,9 +293,6 @@ clone_user_rev() {
     local rev="${3:-HEAD}"
 
     if [ -n "$fetchLFS" ]; then
-        tmpHomePath="$(mktemp -d "${TMPDIR:-/tmp}/nix-prefetch-git-tmp-home-XXXXXXXXXX")"
-        exit_handlers+=(remove_tmpHomePath)
-        HOME="$tmpHomePath"
         clean_git lfs install
     fi
 
@@ -417,6 +414,12 @@ if test -z "$branchName"; then
     branchName=fetchgit
 fi
 
+tmpHomePath="$(mktemp -d "${TMPDIR:-/tmp}/nix-prefetch-git-tmp-home-XXXXXXXXXX")"
+exit_handlers+=(remove_tmpHomePath)
+HOME="$tmpHomePath"
+unset XDG_CONFIG_HOME
+export GIT_CONFIG_NOSYSTEM=1
+
 if test -n "$builder"; then
     test -n "$out" -a -n "$url" -a -n "$rev" || usage
     mkdir -p "$out"