Skip to content

Commit f1aae03

Browse files
bk2204gitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 18cb823 commit f1aae03

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

t/t3905-stash-include-untracked.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,26 @@ test_expect_success 'stash save --include-untracked cleaned the untracked files'
3535
test_cmp expect actual
3636
'
3737

38+
tracked=$(git rev-parse --short $(echo 1 | git hash-object --stdin))
39+
untracked=$(git rev-parse --short $(echo untracked | git hash-object --stdin))
3840
cat > expect.diff <<EOF
3941
diff --git a/HEAD b/HEAD
4042
new file mode 100644
41-
index 0000000..d00491f
43+
index 0000000..$tracked
4244
--- /dev/null
4345
+++ b/HEAD
4446
@@ -0,0 +1 @@
4547
+1
4648
diff --git a/file2 b/file2
4749
new file mode 100644
48-
index 0000000..d00491f
50+
index 0000000..$tracked
4951
--- /dev/null
5052
+++ b/file2
5153
@@ -0,0 +1 @@
5254
+1
5355
diff --git a/untracked/untracked b/untracked/untracked
5456
new file mode 100644
55-
index 0000000..5a72eb2
57+
index 0000000..$untracked
5658
--- /dev/null
5759
+++ b/untracked/untracked
5860
@@ -0,0 +1 @@
@@ -109,10 +111,11 @@ test_expect_success 'stash save -u dirty index' '
109111
git stash -u
110112
'
111113

114+
blob=$(git rev-parse --short $(echo 4 | git hash-object --stdin))
112115
cat > expect <<EOF
113116
diff --git a/file3 b/file3
114117
new file mode 100644
115-
index 0000000..b8626c4
118+
index 0000000..$blob
116119
--- /dev/null
117120
+++ b/file3
118121
@@ -0,0 +1 @@

0 commit comments

Comments
 (0)