From 8646f1f7a53d28f305f30420ad23b670159c53a9 Mon Sep 17 00:00:00 2001 From: zimoun Date: Tue, 4 Jan 2022 21:47:15 +0100 Subject: [PATCH] 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 --- guix/scripts/hash.scm | 2 +- tests/guix-hash.sh | 3 ++- 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"