transport-helper: trivial code shuffle
[gitweb.git] / git-remote-testgit
index 6fb878067733101ec6822105e752bc8633f92e5e..5fd09f965a644a279ac79f5f1d0748650744e922 100755 (executable)
@@ -61,10 +61,31 @@ do
                        echo "feature import-marks=$gitmarks"
                        echo "feature export-marks=$gitmarks"
                fi
-               git fast-export --use-done-feature "${testgitmarks_args[@]}" $refs |
+
+               if test -n "$GIT_REMOTE_TESTGIT_FAILURE"
+               then
+                       echo "feature done"
+                       exit 1
+               fi
+
+               echo "feature done"
+               git fast-export "${testgitmarks_args[@]}" $refs |
                sed -e "s#refs/heads/#${prefix}/heads/#g"
+               echo "done"
                ;;
        export)
+               if test -n "$GIT_REMOTE_TESTGIT_FAILURE"
+               then
+                       # consume input so fast-export doesn't get SIGPIPE;
+                       # git would also notice that case, but we want
+                       # to make sure we are exercising the later
+                       # error checks
+                       while read line; do
+                               test "done" = "$line" && break
+                       done
+                       exit 1
+               fi
+
                before=$(git for-each-ref --format='%(refname) %(objectname)')
 
                git fast-import "${testgitmarks_args[@]}" --quiet