diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-04-07 23:29:34 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-04-07 23:29:34 +0200 |
commit | 9a11f13d9e5cfa1db0a3f42bc9ee886ffa7a5a22 (patch) | |
tree | ac51bad5d24c60057ed97d39db6db8a597c41fcb /git-filter-branch.sh | |
parent | gitremote-helpers(1): clarify refspec behaviour (diff) | |
parent | filter-branch: return to original dir after filtering (diff) | |
download | git-9a11f13d9e5cfa1db0a3f42bc9ee886ffa7a5a22.tar.xz git-9a11f13d9e5cfa1db0a3f42bc9ee886ffa7a5a22.zip |
Merge branch 'jk/filter-branch-come-back-to-original'
When used with "-d temporary-directory" option, "git filter-branch"
failed to come back to the original working tree to perform the
final clean-up procedure.
* jk/filter-branch-come-back-to-original:
filter-branch: return to original dir after filtering
Diffstat (limited to 'git-filter-branch.sh')
-rwxr-xr-x | git-filter-branch.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/git-filter-branch.sh b/git-filter-branch.sh index 53142492af..ac2a005fdb 100755 --- a/git-filter-branch.sh +++ b/git-filter-branch.sh @@ -199,6 +199,7 @@ t) test -d "$tempdir" && die "$tempdir already exists, please remove it" esac +orig_dir=$(pwd) mkdir -p "$tempdir/t" && tempdir="$(cd "$tempdir"; pwd)" && cd "$tempdir/t" && @@ -206,7 +207,7 @@ workdir="$(pwd)" || die "" # Remove tempdir on exit -trap 'cd ../..; rm -rf "$tempdir"' 0 +trap 'cd "$orig_dir"; rm -rf "$tempdir"' 0 ORIG_GIT_DIR="$GIT_DIR" ORIG_GIT_WORK_TREE="$GIT_WORK_TREE" @@ -469,7 +470,7 @@ if [ "$filter_tag_name" ]; then done fi -cd ../.. +cd "$orig_dir" rm -rf "$tempdir" trap - 0 |