Re: [PATCH v2 1/2] [Outreachy] t3903-stash: test without configured user.name and user.email
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 18, 2018, 06:28 UTC
- Message-ID
- <xmqq36ryhpbh.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <a75dcea8-797d-9c9b-3453-2de2a4d983dd@gmail.com>
Slavica Djukic <slavicadj.ip2018@gmail.com> writes:
Show 12 quoted lines
>> Yes, but for that you'd need to be checking the resulting commit >> object that represents the stash entry. It should be created under >> the substitute identity. > Would it be correct to check it like this: > > git reset && > >1 && > git add 1 && > echo "$GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>" >expect && > git stash && > git show -s --format="%an <%ae>" refs/stash >actual && > test_cmp expect actual
So, you create a stash, and grab %an and %ae out of the resulting commit object and store them in actual, and then compare. Makes sense.