From a8217711ce0289c653506e852a065c8190781cc9 Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Mon, 4 Jan 2016 15:08:45 -0800 Subject: [PATCH] fetchgitLocal: make it work in submodules --- pkgs/build-support/fetchgitlocal/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/build-support/fetchgitlocal/default.nix b/pkgs/build-support/fetchgitlocal/default.nix index 830133b982d..60803ddcb1f 100644 --- a/pkgs/build-support/fetchgitlocal/default.nix +++ b/pkgs/build-support/fetchgitlocal/default.nix @@ -10,9 +10,9 @@ let preferLocalBuild = true; } '' cd ${srcStr} - ROOT=$(git rev-parse --show-toplevel) # path to repo + DOT_GIT=$(git rev-parse --resolve-git-dir .git) # path to repo - cp $ROOT/.git/index $ROOT/.git/index-user # backup index + cp $DOT_GIT/index $DOT_GIT/index-user # backup index git reset # reset index git add . # add current directory @@ -21,7 +21,7 @@ let git rev-parse $(git write-tree) \ | tr -d '\n' > $out - mv $ROOT/.git/index-user $ROOT/.git/index # restore index + mv $DOT_GIT/index-user $DOT_GIT/index # restore index ''; gitHash = builtins.readFile gitHashFile; # cache against git hash