Skip to content

Commit

Permalink
t7003: add test to filter a branch with a commit at epoch
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Jul 12, 2012
1 parent be21d16 commit 44b85e8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
3 changes: 2 additions & 1 deletion t/t7003-filter-branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down
13 changes: 11 additions & 2 deletions t/test-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -335,10 +335,19 @@ test_tick () {
# 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"
}
Expand Down

0 comments on commit 44b85e8

Please sign in to comment.