Thread (1 message) 1 message, 1 author, 2017-06-13

Re: [PATCH v4 3/5] stash: add test for stashing in a detached state

From: Junio C Hamano <hidden>
Date: 2017-06-13 20:58:27

Joel Teichroeb [off-list ref] writes:
quoted
quoted
+test_expect_success 'create in a detached state' '
+     test_when_finished "git checkout master" &&
+     git checkout HEAD~1 &&
+     >foo &&
+     git add foo &&
+     STASH_ID=$(git stash create) &&
+     HEAD_ID=$(git rev-parse --short HEAD) &&
+     echo "WIP on (no branch): ${HEAD_ID} initial" >expect &&
+     git show --pretty=%s -s ${STASH_ID} >actual &&
+     test_cmp expect actual
+'
Hmph.  Is the title automatically given to the stash the
only/primary thing that is of interest to us in this test?  I think
we care more about that we record the right thing in the resulting
stash and also after creating the stash the working tree and the
index becomes clean.  Shouldn't we be testing that?
In this case, the title is really what I wanted to test. There are
other tests already to make sure that stash create works, but there
were no tests to ensure that a stash was created with the correct
title when not on a branch.
Ah, OK.

Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help