summaryrefslogtreecommitdiff
path: root/t/t3905-stash-include-untracked.sh
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2018-05-21 02:01:33 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-21 04:55:48 (GMT)
commitf1aae0346a3b9b0ba82a3054d776486823296237 (patch)
tree9676caaee0a1cf71c29b9f7bfb9c1d72bc0f0913 /t/t3905-stash-include-untracked.sh
parent18cb8231b3f5569aaaa55357c70e9e08bf9285a2 (diff)
downloadgit-f1aae0346a3b9b0ba82a3054d776486823296237.zip
git-f1aae0346a3b9b0ba82a3054d776486823296237.tar.gz
git-f1aae0346a3b9b0ba82a3054d776486823296237.tar.bz2
t3905: abstract away SHA-1-specific constants
Adjust the test so that it computes variables for blobs instead of using hard-coded hashes. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3905-stash-include-untracked.sh')
-rwxr-xr-xt/t3905-stash-include-untracked.sh11
1 files changed, 7 insertions, 4 deletions
diff --git a/t/t3905-stash-include-untracked.sh b/t/t3905-stash-include-untracked.sh
index 3ea5b9b..597b063 100755
--- a/t/t3905-stash-include-untracked.sh
+++ b/t/t3905-stash-include-untracked.sh
@@ -35,24 +35,26 @@ test_expect_success 'stash save --include-untracked cleaned the untracked files'
test_cmp expect actual
'
+tracked=$(git rev-parse --short $(echo 1 | git hash-object --stdin))
+untracked=$(git rev-parse --short $(echo untracked | git hash-object --stdin))
cat > expect.diff <<EOF
diff --git a/HEAD b/HEAD
new file mode 100644
-index 0000000..d00491f
+index 0000000..$tracked
--- /dev/null
+++ b/HEAD
@@ -0,0 +1 @@
+1
diff --git a/file2 b/file2
new file mode 100644
-index 0000000..d00491f
+index 0000000..$tracked
--- /dev/null
+++ b/file2
@@ -0,0 +1 @@
+1
diff --git a/untracked/untracked b/untracked/untracked
new file mode 100644
-index 0000000..5a72eb2
+index 0000000..$untracked
--- /dev/null
+++ b/untracked/untracked
@@ -0,0 +1 @@
@@ -109,10 +111,11 @@ test_expect_success 'stash save -u dirty index' '
git stash -u
'
+blob=$(git rev-parse --short $(echo 4 | git hash-object --stdin))
cat > expect <<EOF
diff --git a/file3 b/file3
new file mode 100644
-index 0000000..b8626c4
+index 0000000..$blob
--- /dev/null
+++ b/file3
@@ -0,0 +1 @@