diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-08-21 23:36:28 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-08-22 01:35:47 +0300 |
commit | 9ed104e5cacdc44f2fe7c2b1fdeada94622ca4e9 (patch) | |
tree | 0579d1aeb1d432b547fa1ede3db106b24b7aeaef /t | |
parent | 675a4aaf3b226c0089108221b96559e0baae5de9 (diff) |
ident: say whose identity is missing when giving user.name hint
If `user.name` and `user.email` have not been configured and the
user invokes:
git commit --author=...
without specifying the committer identity, then Git errors out with
a message asking the user to configure `user.name` and `user.email`
but doesn't tell the user which attribution was missing. This can be
confusing for a user new to Git who isn't aware of the distinction
between user, author, and committer.
Give such users a bit more help by extending the error message to
also say which attribution is expected.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t7518-ident-corner-cases.sh | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/t/t7518-ident-corner-cases.sh b/t/t7518-ident-corner-cases.sh index b22f631261..dc3e9c8c88 100755 --- a/t/t7518-ident-corner-cases.sh +++ b/t/t7518-ident-corner-cases.sh @@ -29,7 +29,18 @@ test_expect_success 'empty configured name does not auto-detect' ' sane_unset GIT_AUTHOR_NAME && test_must_fail \ git -c user.name= commit --allow-empty -m foo 2>err && - test_i18ngrep "empty ident name" err + test_i18ngrep "empty ident name" err && + test_i18ngrep "Author identity unknown" err + ) +' + +test_expect_success 'empty configured name does not auto-detect for committer' ' + ( + sane_unset GIT_COMMITTER_NAME && + test_must_fail \ + git -c user.name= commit --allow-empty -m foo 2>err && + test_i18ngrep "empty ident name" err && + test_i18ngrep "Committer identity unknown" err ) ' |