Merge branch 'sb/strbuf-h-update'
[gitweb.git] / t / t4201-shortlog.sh
index da10478f59da1a301edf7def229d37fbc964dce9..d3a7ce6bbb2ca926d200f099d25d26570a3c1ce6 100755 (executable)
@@ -59,7 +59,7 @@ test_expect_success 'setup' '
 fuzz() {
        file=$1 &&
        sed "
-                       s/$_x40/OBJECT_NAME/g
+                       s/$OID_REGEX/OBJECT_NAME/g
                        s/$_x35/OBJID/g
                        s/^ \{6\}[CTa].*/      SUBJECT/g
                        s/^ \{8\}[^ ].*/        CONTINUATION/g
@@ -127,6 +127,11 @@ test_expect_success !MINGW 'shortlog can read --format=raw output' '
        test_cmp expect out
 '
 
+test_expect_success 'shortlog from non-git directory refuses extra arguments' '
+       test_must_fail env GIT_DIR=non-existing git shortlog foo 2>out &&
+       test_i18ngrep "too many arguments" out
+'
+
 test_expect_success 'shortlog should add newline when input line matches wraplen' '
        cat >expect <<\EOF &&
 A U Thor (2):
@@ -187,7 +192,7 @@ test_expect_success 'shortlog with revision pseudo options' '
 
 test_expect_success 'shortlog with --output=<file>' '
        git shortlog --output=shortlog -1 master >output &&
-       test ! -s output &&
+       test_must_be_empty output &&
        test_line_count = 3 shortlog
 '