aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzimoun <zimon.toutoune@gmail.com>2022-01-04 21:47:15 +0100
committerTimothy Sample <samplet@ngyro.com>2022-01-04 20:37:29 -0500
commit8646f1f7a53d28f305f30420ad23b670159c53a9 (patch)
tree7e760bb01258976cb9bab9d6b2781a28f2159220
parente675030fba924a1aef2677f8ab912eaa3c46403c (diff)
downloadguix-8646f1f7a53d28f305f30420ad23b670159c53a9.tar
guix-8646f1f7a53d28f305f30420ad23b670159c53a9.tar.gz
guix hash: Allow '--exclude-vcs' option using 'git' serializer.
* guix/scripts/hash.scm (git-hash): Use '#:select?' with 'git-hash-directory'. * tests/guix-hash.sh: Adjust accordingly. Signed-off-by: Timothy Sample <samplet@ngyro.com>
-rw-r--r--guix/scripts/hash.scm2
-rw-r--r--tests/guix-hash.sh3
2 files changed, 3 insertions, 2 deletions
diff --git a/guix/scripts/hash.scm b/guix/scripts/hash.scm
index d73e3d13dd..c44a4de9a4 100644
--- a/guix/scripts/hash.scm
+++ b/guix/scripts/hash.scm
@@ -69,7 +69,7 @@
((directory) #t)
(else #f)))
(if directory?
- (git-hash-directory file algorithm)
+ (git-hash-directory file algorithm #:select? select?)
(git-hash-file file algorithm)))
diff --git a/tests/guix-hash.sh b/tests/guix-hash.sh
index 854c493514..8b03c7985d 100644
--- a/tests/guix-hash.sh
+++ b/tests/guix-hash.sh
@@ -53,6 +53,7 @@ mkdir "$tmpdir/subdir"
test `guix hash -S nar "$tmpdir"` = 10k1lw41wyrjf9mxydi0is5nkpynlsvgslinics4ppir13g7d74p
test `guix hash -S nar "$tmpdir" -H sha512` = 301ra58c2vahczzxiyfin41mpyb0ljh4dh9zn3ijvwviaw1j40sfzw5skh9x945da88n3785ggifzig7acd6k72h0mpsc20m1f66m9n
+test `guix hash -S git "$tmpdir"` = 1m9yxz99g7askm88h6hzyv4g2bfv57rp5wvwp3iq5ypsplq1xkkk
test `guix hash -S git "$tmpdir" -H sha512` = 158b10d1bsdk4pm8ym9cg9ckfak1b0cgpw7365cl6s341ir380mh2f4ylicyh8khyrfnwq5cn9766d7m8fbfwwl94ndkv456v6a8knr
# Deprecated --recursive option
@@ -76,7 +77,7 @@ test `guix hash -S git $tmpdir` = 0ghlpca9xaswa1ay1g55dknwd9q899mi3ahfr43pq083v8
# ...but remains the same when using `-x'
test `guix hash -S nar $tmpdir -x` = 10k1lw41wyrjf9mxydi0is5nkpynlsvgslinics4ppir13g7d74p
-test `guix hash -S git $tmpdir -x` = 0ghlpca9xaswa1ay1g55dknwd9q899mi3ahfr43pq083v8wisjc7
+test `guix hash -S git $tmpdir -x` = 1m9yxz99g7askm88h6hzyv4g2bfv57rp5wvwp3iq5ypsplq1xkkk
# Without '-r', this should fail.
! guix hash "$tmpdir"