test/send-email: --[no-]xmailer tests
[gitweb.git] / git-filter-branch.sh
index ca3d53919ad3b9b07a7147c31b7719c6ccca6232..e6e99f5bb5102d394a25f156dbcba956f246054b 100755 (executable)
@@ -283,11 +283,12 @@ while read commit parents; do
 
        case "$filter_subdir" in
        "")
-               git read-tree -i -m $commit
+               GIT_ALLOW_NULL_SHA1=1 git read-tree -i -m $commit
                ;;
        *)
                # The commit may not have the subdirectory at all
-               err=$(git read-tree -i -m $commit:"$filter_subdir" 2>&1) || {
+               err=$(GIT_ALLOW_NULL_SHA1=1 \
+                     git read-tree -i -m $commit:"$filter_subdir" 2>&1) || {
                        if ! git rev-parse -q --verify $commit:"$filter_subdir"
                        then
                                rm -f "$GIT_INDEX_FILE"
@@ -331,7 +332,13 @@ while read commit parents; do
        parentstr=
        for parent in $parents; do
                for reparent in $(map "$parent"); do
-                       parentstr="$parentstr -p $reparent"
+                       case "$parentstr " in
+                       *" -p $reparent "*)
+                               ;;
+                       *)
+                               parentstr="$parentstr -p $reparent"
+                               ;;
+                       esac
                done
        done
        if [ "$filter_parent" ]; then