test prerequisites: enumerate with commas
[gitweb.git] / t / annotate-tests.sh
index c9d105d70725b9a97d5a9518e83c615821e91c23..071e4d7d3ee9729b5caeb34ffd54ae88b7e1e0d8 100644 (file)
@@ -1,6 +1,17 @@
 # This file isn't used as a test script directly, instead it is
 # sourced from t8001-annotate.sh and t8002-blame.sh.
 
+if test_have_prereq MINGW
+then
+  sanitize_L () {
+       echo "$1" | sed 'sX\(^-L\|,\)\^\?/X&\\;*Xg'
+  }
+else
+  sanitize_L () {
+       echo "$1"
+  }
+fi
+
 check_count () {
        head= &&
        file='file' &&
@@ -10,6 +21,7 @@ check_count () {
                case "$1" in
                -h) head="$2"; shift; shift ;;
                -f) file="$2"; shift; shift ;;
+               -L*) options="$options $(sanitize_L "$1")"; shift ;;
                -*) options="$options $1"; shift ;;
                *) break ;;
                esac
@@ -116,6 +128,27 @@ test_expect_success 'blame evil merge' '
        check_count A 2 B 1 B1 2 B2 1 "A U Thor" 1
 '
 
+test_expect_success 'blame huge graft' '
+       test_when_finished "git checkout branch2" &&
+       test_when_finished "rm -f .git/info/grafts" &&
+       graft= &&
+       for i in 0 1 2
+       do
+               for j in 0 1 2 3 4 5 6 7 8 9
+               do
+                       git checkout --orphan "$i$j" &&
+                       printf "%s\n" "$i" "$j" >file &&
+                       test_tick &&
+                       GIT_AUTHOR_NAME=$i$j GIT_AUTHOR_EMAIL=$i$j@test.git \
+                       git commit -a -m "$i$j" &&
+                       commit=$(git rev-parse --verify HEAD) &&
+                       graft="$graft$commit "
+               done
+       done &&
+       printf "%s " $graft >.git/info/grafts &&
+       check_count -h 00 01 1 10 1
+'
+
 test_expect_success 'setup incomplete line' '
        echo "incomplete" | tr -d "\\012" >>file &&
        GIT_AUTHOR_NAME="C" GIT_AUTHOR_EMAIL="C@test.git" \