]> git.ipfire.org Git - thirdparty/git.git/blobdiff - git-filter-branch.sh
Merge branch 'lc/filter-branch-too-many-refs'
[thirdparty/git.git] / git-filter-branch.sh
index ca3d53919ad3b9b07a7147c31b7719c6ccca6232..86d6994619151fb63327848e6763b07971017ad7 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"