[PATCH v2 1/2] [Outreachy] t3903-stash: test without configured user.name and user.email
- From
- Slavica Djukic <slavicadj.ip2018@gmail.com>
- Date
- Nov 14, 2018, 22:25 UTC
- Message-ID
- <20181114222524.2624-1-slawica92@hotmail.com>
- In-Reply-To
- <20181114221218.3112-1-slawica92@hotmail.com>
Add test to document that stash fails if user.name and user.email are not configured. In the later commit, test will be updated to expect success.
Signed-off-by: Slavica Djukic <slawica92@hotmail.com> --- t/t3903-stash.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh index cd216655b..bab8bec67 100755 --- a/t/t3903-stash.sh +++ b/t/t3903-stash.sh @@ -1096,4 +1096,27 @@ test_expect_success 'stash -- <subdir> works with binary files' ' test_path_is_file subdir/untracked ' +test_expect_failure 'stash works when user.name and user.email are not set' ' + git reset && + git var GIT_COMMITTER_IDENT >expected && + >1 && + git add 1 && + git stash && + git var GIT_COMMITTER_IDENT >actual && + test_cmp expected actual && + >2 && + git add 2 && + test_config user.useconfigonly true && + test_config stash.usebuiltin true && + ( + sane_unset GIT_AUTHOR_NAME && + sane_unset GIT_AUTHOR_EMAIL && + sane_unset GIT_COMMITTER_NAME && + sane_unset GIT_COMMITTER_EMAIL && + test_unconfig user.email && + test_unconfig user.name && + git stash + ) +' + test_done
-- 2.19.1.1052.gd166e6afe