summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2010-05-21 04:02:21 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2010-05-21 04:02:21 -0700
commit4cbf42e1519015a30401992815331c048ff3c982 (patch)
treead877465c105401394e9c32cce8389e055b67d31 /t
parentMerge branch 'jn/gitweb-caching-prep' (diff)
parentfsck: check ident lines in commit objects (diff)
downloadtgif-4cbf42e1519015a30401992815331c048ff3c982.tar.xz
Merge branch 'jn/fsck-ident'
* jn/fsck-ident: fsck: check ident lines in commit objects
Diffstat (limited to 't')
-rwxr-xr-xt/t1450-fsck.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh
index 49cae3ed52..22a80c8268 100755
--- a/t/t1450-fsck.sh
+++ b/t/t1450-fsck.sh
@@ -57,6 +57,34 @@ test_expect_success 'branch pointing to non-commit' '
git update-ref -d refs/heads/invalid
'
+new=nothing
+test_expect_success 'email without @ is okay' '
+ git cat-file commit HEAD >basis &&
+ sed "s/@/AT/" basis >okay &&
+ new=$(git hash-object -t commit -w --stdin <okay) &&
+ echo "$new" &&
+ git update-ref refs/heads/bogus "$new" &&
+ git fsck 2>out &&
+ cat out &&
+ ! grep "error in commit $new" out
+'
+git update-ref -d refs/heads/bogus
+rm -f ".git/objects/$new"
+
+new=nothing
+test_expect_success 'email with embedded > is not okay' '
+ git cat-file commit HEAD >basis &&
+ sed "s/@[a-z]/&>/" basis >bad-email &&
+ new=$(git hash-object -t commit -w --stdin <bad-email) &&
+ echo "$new" &&
+ git update-ref refs/heads/bogus "$new" &&
+ git fsck 2>out &&
+ cat out &&
+ grep "error in commit $new" out
+'
+git update-ref -d refs/heads/bogus
+rm -f ".git/objects/$new"
+
cat > invalid-tag <<EOF
object ffffffffffffffffffffffffffffffffffffffff
type commit