diff options
author | Eric Seidel <gridaphobe@gmail.com> | 2016-01-04 15:08:45 -0800 |
---|---|---|
committer | Eric Seidel <gridaphobe@gmail.com> | 2016-01-04 15:09:00 -0800 |
commit | a8217711ce0289c653506e852a065c8190781cc9 (patch) | |
tree | 788116e2a8b38f8499a29e6b6d967fbe8112cd1e | |
parent | 2027caa8758eba117cf38f5ec6892bb93e68ddfa (diff) |
fetchgitLocal: make it work in submodules
-rw-r--r-- | pkgs/build-support/fetchgitlocal/default.nix | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pkgs/build-support/fetchgitlocal/default.nix b/pkgs/build-support/fetchgitlocal/default.nix index 830133b982d3b..60803ddcb1f8a 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 |