-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'jk/send-email-sender-prompt'
General clean-ups in various areas, originally written to support a patch that later turned out to be unneeded. * jk/send-email-sender-prompt: t9001: check send-email behavior with implicit sender t: add tests for "git var" ident: keep separate "explicit" flags for author and committer ident: make user_ident_explicitly_given static t7502: factor out autoident prerequisite test-lib: allow negation of prerequisites
- Loading branch information
Showing
9 changed files
with
169 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/sh | ||
|
||
test_description='basic sanity checks for git var' | ||
. ./test-lib.sh | ||
|
||
test_expect_success 'get GIT_AUTHOR_IDENT' ' | ||
test_tick && | ||
echo "$GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> $GIT_AUTHOR_DATE" >expect && | ||
git var GIT_AUTHOR_IDENT >actual && | ||
test_cmp expect actual | ||
' | ||
|
||
test_expect_success 'get GIT_COMMITTER_IDENT' ' | ||
test_tick && | ||
echo "$GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE" >expect && | ||
git var GIT_COMMITTER_IDENT >actual && | ||
test_cmp expect actual | ||
' | ||
|
||
test_expect_success !AUTOIDENT 'requested identites are strict' ' | ||
( | ||
sane_unset GIT_COMMITTER_NAME && | ||
sane_unset GIT_COMMITTER_EMAIL && | ||
test_must_fail git var GIT_COMMITTER_IDENT | ||
) | ||
' | ||
|
||
# For git var -l, we check only a representative variable; | ||
# testing the whole output would make our test too brittle with | ||
# respect to unrelated changes in the test suite's environment. | ||
test_expect_success 'git var -l lists variables' ' | ||
git var -l >actual && | ||
echo "$GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> $GIT_AUTHOR_DATE" >expect && | ||
sed -n s/GIT_AUTHOR_IDENT=//p <actual >actual.author && | ||
test_cmp expect actual.author | ||
' | ||
|
||
test_expect_success 'git var -l lists config' ' | ||
git var -l >actual && | ||
echo false >expect && | ||
sed -n s/core\\.bare=//p <actual >actual.bare && | ||
test_cmp expect actual.bare | ||
' | ||
|
||
test_expect_success 'listing and asking for variables are exclusive' ' | ||
test_must_fail git var -l GIT_COMMITTER_IDENT | ||
' | ||
|
||
test_done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters