Skip to content

Commit

Permalink
t3903: stop hard-coding commit sha1s
Browse files Browse the repository at this point in the history
When testing the diff output of "git stash list", we look
for the stash's subject of "WIP on master: $sha1", even
though it's not relevant to the diff output. This makes the
test brittle to refactoring, as any changes to earlier tests
may impact the commit sha1.

Since we don't care about the commit subject here, we can
simply ask stash not to print it.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Apr 22, 2015
1 parent fdf96a2 commit f2f3fc9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions t/t3903-stash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -695,8 +695,8 @@ test_expect_success 'setup stash with index and worktree changes' '
'

test_expect_success 'stash list implies --first-parent -m' '
cat >expect <<-\EOF &&
stash@{0}: WIP on master: b27a2bc subdir
cat >expect <<-EOF &&
stash@{0}
diff --git a/file b/file
index 257cc56..d26b33d 100644
Expand All @@ -706,13 +706,13 @@ test_expect_success 'stash list implies --first-parent -m' '
-foo
+working
EOF
git stash list -p >actual &&
git stash list --format=%gd -p >actual &&
test_cmp expect actual
'

test_expect_success 'stash list --cc shows combined diff' '
cat >expect <<-\EOF &&
stash@{0}: WIP on master: b27a2bc subdir
stash@{0}
diff --cc file
index 257cc56,9015a7a..d26b33d
Expand All @@ -723,7 +723,7 @@ test_expect_success 'stash list --cc shows combined diff' '
-index
++working
EOF
git stash list -p --cc >actual &&
git stash list --format=%gd -p --cc >actual &&
test_cmp expect actual
'

Expand Down

0 comments on commit f2f3fc9

Please sign in to comment.