Merge branch 'jk/progress-delay-fix'
[gitweb.git] / t / t4201-shortlog.sh
index ae08b57712e382a4cba7f7a51a499b4621a38c84..da10478f59da1a301edf7def229d37fbc964dce9 100755 (executable)
@@ -9,6 +9,7 @@ test_description='git shortlog
 . ./test-lib.sh
 
 test_expect_success 'setup' '
+       test_tick &&
        echo 1 >a1 &&
        git add a1 &&
        tree=$(git write-tree) &&
@@ -59,7 +60,7 @@ fuzz() {
        file=$1 &&
        sed "
                        s/$_x40/OBJECT_NAME/g
-                       s/$_x05/OBJID/g
+                       s/$_x35/OBJID/g
                        s/^ \{6\}[CTa].*/      SUBJECT/g
                        s/^ \{8\}[^ ].*/        CONTINUATION/g
                " <"$file" >"$file.fuzzy" &&
@@ -81,7 +82,7 @@ test_expect_success 'pretty format' '
 
 test_expect_success '--abbrev' '
        sed s/SUBJECT/OBJID/ expect.template >expect &&
-       git shortlog --format="%h" --abbrev=5 HEAD >log &&
+       git shortlog --format="%h" --abbrev=35 HEAD >log &&
        fuzz log >log.predictable &&
        test_cmp expect log.predictable
 '
@@ -190,4 +191,23 @@ test_expect_success 'shortlog with --output=<file>' '
        test_line_count = 3 shortlog
 '
 
+test_expect_success 'shortlog --committer (internal)' '
+       git checkout --orphan side &&
+       git commit --allow-empty -m one &&
+       git commit --allow-empty -m two &&
+       GIT_COMMITTER_NAME="Sin Nombre" git commit --allow-empty -m three &&
+
+       cat >expect <<-\EOF &&
+            2  C O Mitter
+            1  Sin Nombre
+       EOF
+       git shortlog -nsc HEAD >actual &&
+       test_cmp expect actual
+'
+
+test_expect_success 'shortlog --committer (external)' '
+       git log --format=full | git shortlog -nsc >actual &&
+       test_cmp expect actual
+'
+
 test_done