From 958e67c0a8b7f12462ad1828ac3b3178181ea4e9 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 22 Nov 2007 16:48:55 -0800 Subject: Make test scripts executable. --- t/t7501-commit.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 t/t7501-commit.sh (limited to 't/t7501-commit.sh') diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh old mode 100644 new mode 100755 -- cgit v1.3-5-g9baa From d63c2fd192271ea2d85c81edfad90aa42fec26ee Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Fri, 2 Nov 2007 11:33:06 -0400 Subject: Add testcase for amending and fixing author in git commit. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We used to clobber author time, but we shouldn't. Signed-off-by: Kristian Høgsberg Signed-off-by: Junio C Hamano --- t/t7501-commit.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 't/t7501-commit.sh') diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh index 9dba104b1f..e601028d02 100755 --- a/t/t7501-commit.sh +++ b/t/t7501-commit.sh @@ -242,4 +242,19 @@ test_expect_success 'multiple -m' ' ' +author="The Real Author " +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_done -- cgit v1.3-5-g9baa From 1200993a1e885fd67d1a1d63da9d2a0e1ee5bcea Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Thu, 15 Nov 2007 09:49:58 -0500 Subject: t7501-commit: Add test for git commit with dirty index. Signed-off-by: Junio C Hamano --- t/t7501-commit.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 't/t7501-commit.sh') diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh index e601028d02..ce83af3a02 100755 --- a/t/t7501-commit.sh +++ b/t/t7501-commit.sh @@ -257,4 +257,14 @@ test_expect_success 'amend commit to fix author' ' diff expected current ' + +test_expect_success 'git commit 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_done -- cgit v1.3-5-g9baa