diff options
Diffstat (limited to 't/t7501-commit.sh')
| -rwxr-xr-x | t/t7501-commit.sh | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh index 0316ecf5a1..05aa97d6f3 100755 --- a/t/t7501-commit.sh +++ b/t/t7501-commit.sh @@ -4,7 +4,7 @@ # # FIXME: Test the various index usages, -i and -o, test reflog, -# signoff, hooks +# signoff test_description='git-commit' . ./test-lib.sh @@ -244,8 +244,35 @@ test_expect_success 'multiple -m' ' ' +author="The Real Author <someguy@his.email.org>" +test_expect_success 'amend commit to fix author' ' + + oldtick=$GIT_AUTHOR_DATE && + test_tick && + git reset --hard && + git cat-file -p HEAD | + sed -e "s/author.*/author $author $oldtick/" \ + -e "s/^\(committer.*> \).*$/\1$GIT_COMMITTER_DATE/" > \ + expected && + git commit --amend --author="$author" && + git cat-file -p HEAD > current && + diff expected current + +' + +test_expect_success 'git commit <file> with dirty index' ' + echo tacocat > elif && + echo tehlulz > chz && + git add chz && + git commit elif -m "tacocat is a palindrome" && + git show --stat | grep elif && + git diff --cached | grep chz +' + test_expect_success 'same tree (single parent)' ' + git reset --hard + if git commit -m empty then echo oops -- should have complained |
