diff options
author | Maximilian Bosch <maximilian@mbosch.me> | 2020-07-28 22:46:39 +0200 |
---|---|---|
committer | Maximilian Bosch <maximilian@mbosch.me> | 2020-07-28 22:46:39 +0200 |
commit | e4940e90f399c5cde5f44f099ca5cdf5340d22b8 (patch) | |
tree | ff3be32b97cf31f800492c6bc8de275d6399beff /tests | |
parent | f74243846512ffabf082985bca395890c97643e0 (diff) |
Restore backwards-compat for current `builtins.fetchGit`
If a repo is dirty, it used to return a `rev` object with an "empty"
sha1 (0000000000000000000000000000000000000000). Please note that this
only applies for `builtins.fetchGit` and *not* for `builtins.fetchTree{
type = "git"; }`.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/fetchGit.sh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/fetchGit.sh b/tests/fetchGit.sh index 1b9364e60..cedd796f7 100644 --- a/tests/fetchGit.sh +++ b/tests/fetchGit.sh @@ -89,6 +89,8 @@ path2=$(nix eval --impure --raw --expr "(builtins.fetchGit $repo).outPath") [ ! -e $path2/.git ] [[ $(cat $path2/dir1/foo) = foo ]] +[[ $(nix eval --impure --raw --expr "(builtins.fetchGit $repo).rev") = 0000000000000000000000000000000000000000 ]] + # ... unless we're using an explicit ref or rev. path3=$(nix eval --impure --raw --expr "(builtins.fetchGit { url = $repo; ref = \"master\"; }).outPath") [[ $path = $path3 ]] @@ -129,7 +131,7 @@ path2=$(nix eval --impure --raw --expr "(builtins.fetchGit file://$repo).outPath # Using local path with branch other than 'master' should work when clean or dirty path3=$(nix eval --impure --raw --expr "(builtins.fetchGit $repo).outPath") # (check dirty-tree handling was used) -[[ $(nix eval --impure --expr "(builtins.fetchGit $repo).rev or null") = null ]] +[[ $(nix eval --impure --raw --expr "(builtins.fetchGit $repo).rev") = 0000000000000000000000000000000000000000 ]] # Committing shouldn't change store path, or switch to using 'master' git -C $repo commit -m 'Bla5' -a |