mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-20 00:53:12 +03:00
fetchgitLocal: make it work in submodules
This commit is contained in:
parent
2027caa875
commit
a8217711ce
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user