]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t6006-rev-list-format.sh
tests: use "git xyzzy" form (t3600 - t6999)
[thirdparty/git.git] / t / t6006-rev-list-format.sh
index 1e4541afea07daa094895244f0e49803623cd1cd..86bf7e14ba5bb9a76ef00cb5a3564e326f674a18 100755 (executable)
@@ -6,8 +6,8 @@ test_description='git rev-list --pretty=format test'
 
 test_tick
 test_expect_success 'setup' '
-touch foo && git add foo && git-commit -m "added foo" &&
-  echo changed >foo && git-commit -a -m "changed foo"
+touch foo && git add foo && git commit -m "added foo" &&
+  echo changed >foo && git commit -a -m "changed foo"
 '
 
 # usage: test_format name format_string <expected_output
@@ -15,7 +15,7 @@ test_format() {
        cat >expect.$1
        test_expect_success "format $1" "
 git rev-list --pretty=format:$2 master >output.$1 &&
-git diff expect.$1 output.$1
+test_cmp expect.$1 output.$1
 "
 }
 
@@ -110,7 +110,7 @@ include an iso8859 character: ¡bueno!
 EOF
 test_expect_success 'setup complex body' '
 git config i18n.commitencoding iso8859-1 &&
-  echo change2 >foo && git-commit -a -F commit-msg
+  echo change2 >foo && git commit -a -F commit-msg
 '
 
 test_format complex-encoding %e <<'EOF'
@@ -139,4 +139,20 @@ commit 131a310eb913d107dd3c09a65d1651175898735d
 commit 86c75cfd708a0e5868dc876ed5b8bb66c80b4873
 EOF
 
+test_expect_success '%ad respects --date=' '
+       echo 2005-04-07 >expect.ad-short &&
+       git log -1 --date=short --pretty=tformat:%ad >output.ad-short master &&
+       test_cmp expect.ad-short output.ad-short
+'
+
+test_expect_success 'empty email' '
+       test_tick &&
+       C=$(GIT_AUTHOR_EMAIL= git commit-tree HEAD^{tree} </dev/null) &&
+       A=$(git show --pretty=format:%an,%ae,%ad%n -s $C) &&
+       test "$A" = "A U Thor,,Thu Apr 7 15:14:13 2005 -0700" || {
+               echo "Eh? $A" >failure
+               false
+       }
+'
+
 test_done