stash: tolerate missing user identity
commit3bc2111fc2e9e8ff33b48bb2ccd17b77ca7dbced
authorSlavica Djukic <slavicadj.ip2018@gmail.com>
Sun, 18 Nov 2018 13:44:07 +0000 (18 14:44 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sun, 18 Nov 2018 23:24:34 +0000 (19 08:24 +0900)
tree2f737f78b996ce19ad3ce9e7f789e00a4ae45b68
parentd166e6afe5f257217836ef24a73764eba390c58d
stash: tolerate missing user identity

The "git stash" command insists on having a usable user identity to
the same degree as the "git commit-tree" and "git commit" commands
do, because it uses the same codepath that creates commit objects
as these commands.

It is not strictly necesary to do so. Check if we will barf before
creating commit objects and then supply fake identity to please the
machinery that creates commits.
Add test to document that stash executes correctly both with and
without valid ident.

This is not that much of usability improvement, as the users who run
"git stash" would eventually want to record their changes that are
temporarily stored in the stashes in a more permanent history by
committing, and they must do "git config user.{name,email}" at that
point anyway, so arguably this change is only delaying a step that
is necessary to work in the repository.

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Slavica Djukic <slawica92@hotmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-stash.sh
t/t3903-stash.sh