Merge branch 'ml/filter-branch-portability-fix' into next
authorJunio C Hamano <gitster@pobox.com>
Tue, 20 Mar 2018 21:22:48 +0000 (14:22 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 20 Mar 2018 21:22:48 +0000 (14:22 -0700)
Shell script portability fix.

* ml/filter-branch-portability-fix:
filter-branch: use printf instead of echo -e

1  2 
git-filter-branch.sh
diff --combined git-filter-branch.sh
index c285fdb90d1a86cd2f360e3ff1768c82a7162fd5,98c76ec589b053c112ddc86b6821f2acf17b7ab0..2587a01b9b4fa0344c695cb635e6eed26257e9f8
@@@ -310,7 -310,7 +310,7 @@@ git rev-list --reverse --topo-order --d
        die "Could not get the commits"
  commits=$(wc -l <../revs | tr -d " ")
  
 -test $commits -eq 0 && die "Found nothing to rewrite"
 +test $commits -eq 0 && die_with_status 2 "Found nothing to rewrite"
  
  # Rewrite the commits
  report_progress ()
@@@ -627,12 -627,12 +627,12 @@@ the
                                print H "$_:$f\n" or die;
                        }
                        close(H) or die;' || die "Unable to save state")
-       state_tree=$(/bin/echo -e "100644 blob $state_blob\tfilter.map" | git mktree)
+       state_tree=$(printf '100644 blob %s\tfilter.map\n' "$state_blob" | git mktree)
        if test -n "$state_commit"
        then
-               state_commit=$(/bin/echo "Sync" | git commit-tree "$state_tree" -p "$state_commit")
+               state_commit=$(echo "Sync" | git commit-tree "$state_tree" -p "$state_commit")
        else
-               state_commit=$(/bin/echo "Sync" | git commit-tree "$state_tree" )
+               state_commit=$(echo "Sync" | git commit-tree "$state_tree" )
        fi
        git update-ref "$state_branch" "$state_commit"
  fi