diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-07-22 12:54:08 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-07-22 12:55:05 -0700 |
commit | 9a0231b395cb9720365b7066312eeaa86e37ed31 (patch) | |
tree | c0bbb57aeb5653275e237f72f1da25599e29056c /t | |
parent | Update draft release notes for 7th batch (diff) | |
parent | t7003: add test to filter a branch with a commit at epoch (diff) | |
download | tgif-9a0231b395cb9720365b7066312eeaa86e37ed31.tar.xz |
Merge branch 'jc/maint-filter-branch-epoch-date'
In 1.7.9 era, we taught "git rebase" about the raw timestamp format
but we did not teach the same trick to "filter-branch", which rolled
a similar logic on its own. Because of this, "filter-branch" failed
to rewrite commits with ancient timestamps.
* jc/maint-filter-branch-epoch-date:
t7003: add test to filter a branch with a commit at epoch
date.c: Fix off by one error in object-header date parsing
filter-branch: do not forget the '@' prefix to force git-timestamp
Diffstat (limited to 't')
-rwxr-xr-x | t/t7003-filter-branch.sh | 3 | ||||
-rw-r--r-- | t/test-lib-functions.sh | 13 |
2 files changed, 13 insertions, 3 deletions
diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh index e0227730de..4d13e10de1 100755 --- a/t/t7003-filter-branch.sh +++ b/t/t7003-filter-branch.sh @@ -5,7 +5,8 @@ test_description='git filter-branch' test_expect_success 'setup' ' test_commit A && - test_commit B && + GIT_COMMITTER_DATE="@0 +0000" GIT_AUTHOR_DATE="@0 +0000" && + test_commit --notick B && git checkout -b branch B && test_commit D && mkdir dir && diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh index 16397691d9..80daaca780 100644 --- a/t/test-lib-functions.sh +++ b/t/test-lib-functions.sh @@ -143,10 +143,19 @@ test_pause () { # Both <file> and <contents> default to <message>. test_commit () { - file=${2:-"$1.t"} + notick= && + if test "z$1" = "z--notick" + then + notick=yes + shift + fi && + file=${2:-"$1.t"} && echo "${3-$1}" > "$file" && git add "$file" && - test_tick && + if test -z "$notick" + then + test_tick + fi && git commit -m "$1" && git tag "$1" } |