t7003: add test to filter a branch with a commit at epoch
Running filter-branch on a history that has a commit with timestamp at epoch used to fail, but it should have been fixed. Add test to make sure it won't break again. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Jul 12, 2012 at 13:51 UTC
44b85e89d70da5ee7fc688d4a9c021f6a419b363
2 files changed
+13
-3
t/t7003-filter-branch.sh
+2
-1
@@ -5,7 +5,8 @@ test_description='git filter-branch'
5
6
test_expect_success 'setup' '
7
test_commit A &&
8
- test_commit B &&
8
+ GIT_COMMITTER_DATE="@0 +0000" GIT_AUTHOR_DATE="@0 +0000" &&
9
+ test_commit --notick B &&
10
git checkout -b branch B &&
11
test_commit D &&
12
mkdir dir &&
t/test-lib.sh
+11
-2
@@ -335,10 +335,19 @@ test_tick () {
335
# Both <file> and <contents> default to <message>.
336
337
test_commit () {
338
- file=${2:-"$1.t"}
338
+ notick= &&
339
+ if test "z$1" = "z--notick"
340
+ then
341
+ notick=yes
342
+ shift
343
+ fi &&
344
+ file=${2:-"$1.t"} &&
345
echo "${3-$1}" > "$file" &&
346
git add "$file" &&
341
- test_tick &&
347
+ if test -z "$notick"
348
+ then
349
+ test_tick
350
+ fi &&
351
git commit -m "$1" &&
352
git tag "$1"
353
}