Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Gummerer <t.gummerer@gmail.com>2019-03-07 01:09:11 +0300
committerJunio C Hamano <gitster@pobox.com>2019-03-07 03:41:40 +0300
commit0640897dc5ff1f75308d3ebb45e152aed40bb9a3 (patch)
tree821aef5beab5ca9ddc446fa2dacf935c97eb3097 /t/t3903-stash.sh
parentfd5a58477c62ddb6ec16cf7b5b2da7597f0fa398 (diff)
ident: don't require calling prepare_fallback_ident first
In fd5a58477c ("ident: add the ability to provide a "fallback identity"", 2019-02-25) I made it a requirement to call prepare_fallback_ident as the first function in the ident API. However in stash we didn't actually end up following that. This leads to a BUG if user.email and user.name are set. It was not caught in the test suite because we only rely on environment variables for setting the user name and email instead of the config. Instead of making it a bug to call other functions in the ident API first, just return silently if the identity of a user was already set up. Reported-by: Denton Liu <liu.denton@gmail.com> Helped-by: Jeff King <peff@peff.net> Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3903-stash.sh')
-rwxr-xr-xt/t3903-stash.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh
index 5f8272b6f9..2115e8767e 100755
--- a/t/t3903-stash.sh
+++ b/t/t3903-stash.sh
@@ -1096,6 +1096,12 @@ test_expect_success 'stash -- <subdir> works with binary files' '
test_path_is_file subdir/untracked
'
+test_expect_success 'stash with user.name and user.email set works' '
+ test_config user.name "A U Thor" &&
+ test_config user.email "a.u@thor" &&
+ git stash
+'
+
test_expect_success 'stash works when user.name and user.email are not set' '
git reset &&
>1 &&