X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-filter-branch.sh;h=6b5f2251b6b5f0b9a43e16296c390e991c6fa13a;hb=bd2c86ef00f032be925edacfc2d284ab9b6b9eab;hp=88fb0f070e5f32c62ae47f90f1f27ffeef836d8f;hpb=1c1f046c43d3bb9ba2c094bbe2e87df833b71508;p=git.git diff --git a/git-filter-branch.sh b/git-filter-branch.sh index 88fb0f070..6b5f2251b 100755 --- a/git-filter-branch.sh +++ b/git-filter-branch.sh @@ -139,6 +139,7 @@ do continue ;; --remap-to-ancestor) + # deprecated ($remap_to_ancestor is set now automatically) shift remap_to_ancestor=t continue @@ -265,7 +266,14 @@ mkdir ../map || die "Could not create map/ directory" # we need "--" only if there are no path arguments in $@ nonrevs=$(git rev-parse --no-revs "$@") || exit -test -z "$nonrevs" && dashdash=-- || dashdash= +if test -z "$nonrevs" +then + dashdash=-- +else + dashdash= + remap_to_ancestor=t +fi + rev_args=$(git rev-parse --revs-only "$@") case "$filter_subdir" in @@ -355,7 +363,7 @@ while read commit parents; do sed -e '1,/^$/d' <../commit | \ eval "$filter_msg" > ../message || die "msg filter failed: $filter_msg" - @SHELL_PATH@ -c "$filter_commit" "git commit-tree" \ + workdir=$workdir @SHELL_PATH@ -c "$filter_commit" "git commit-tree" \ $(git write-tree) $parentstr < ../message > ../map/$commit || die "could not write rewritten commit" done <../revs