summary refs log tree commit diff
path: root/tests/guix-hash.sh
diff options
context:
space:
mode:
authorJan Nieuwenhuizen <janneke@gnu.org>2016-09-06 08:28:33 +0200
committerLudovic Courtès <ludo@gnu.org>2016-09-07 12:00:35 +0200
commit392a4e122350367c4b4ac331db5ec28360c7f38c (patch)
tree7ecc0c99cb648fadf76ddb91b99f448028840ef6 /tests/guix-hash.sh
parentafa54a38b738e6ddf4fb25757410cf7b24067b39 (diff)
downloadguix-392a4e122350367c4b4ac331db5ec28360c7f38c.tar.gz
guix hash: Add --exclude-vcs option.
* guix/scripts/hash.scm (show-help): Add help text for --exclude-vcs option.
(%options): Add --exclude-vcs option.
(guix-hash): Handle exclude-vcs option.
* doc/guix.texi ("Invoking guix hash"): Update doc.
* tests/guix-hash.sh: Add test.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'tests/guix-hash.sh')
-rw-r--r--tests/guix-hash.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/guix-hash.sh b/tests/guix-hash.sh
index 23df01d417..44213d51af 100644
--- a/tests/guix-hash.sh
+++ b/tests/guix-hash.sh
@@ -1,5 +1,6 @@
 # GNU Guix --- Functional package management for GNU
 # Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org>
+# Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
 #
 # This file is part of GNU Guix.
 #
@@ -46,3 +47,18 @@ then false; else true; fi
 # the archive format doesn't support.
 if guix hash -r /dev/null
 then false; else true; fi
+
+# Adding a .git directory
+mkdir "$tmpdir/.git"
+touch "$tmpdir/.git/foo"
+
+# ...changes the hash
+test `guix hash -r $tmpdir` = 0a50z04zyzf7pidwxv0nwbj82pgzbrhdy9562kncnvkcfvb48m59
+
+# ...but remains the same when using `-x'
+test `guix hash -r $tmpdir -x` = 10k1lw41wyrjf9mxydi0is5nkpynlsvgslinics4ppir13g7d74p
+
+# Without '-r', this should fail.
+if guix hash "$tmpdir"
+then false; else true; fi
+