summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--date.c2
-rwxr-xr-xgit-filter-branch.sh2
-rwxr-xr-xt/t7003-filter-branch.sh3
-rw-r--r--t/test-lib-functions.sh13
4 files changed, 15 insertions, 5 deletions
diff --git a/date.c b/date.c
index 1fdcf7c..57331ed 100644
--- a/date.c
+++ b/date.c
@@ -624,7 +624,7 @@ static int match_object_header_date(const char *date, unsigned long *timestamp,
unsigned long stamp;
int ofs;
- if (*date < '0' || '9' <= *date)
+ if (*date < '0' || '9' < *date)
return -1;
stamp = strtoul(date, &end, 10);
if (*end != ' ' || stamp == ULONG_MAX || (end[1] != '+' && end[1] != '-'))
diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index add2c02..178e453 100755
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -84,7 +84,7 @@ set_ident () {
s/.*/GIT_'$uid'_EMAIL='\''&'\''; export GIT_'$uid'_EMAIL/p
g
- s/^'$lid' [^<]* <[^>]*> \(.*\)$/\1/
+ s/^'$lid' [^<]* <[^>]*> \(.*\)$/@\1/
s/'\''/'\''\'\'\''/g
s/.*/GIT_'$uid'_DATE='\''&'\''; export GIT_'$uid'_DATE/p
diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh
index e022773..4d13e10 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 1639769..80daaca 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"
}