summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a6d97d4)
raw | patch | inline | side by side (parent: a6d97d4)
author | Junio C Hamano <gitster@pobox.com> | |
Sat, 5 Jan 2008 20:18:43 +0000 (12:18 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 7 Jan 2008 02:41:43 +0000 (18:41 -0800) |
'git-filter-branch branch' could fail producing the error:
"Which ref do you want to rewrite?" if existed another branch
or tag, which name was 'branch-something' or 'something/branch'.
[jc: original report and fix were done between Dmitry Potapov
and Dscho; I rewrote it using "rev-parse --symbolic-full-name"]
Signed-off-by: Junio C Hamano <gitster@pobox.com>
"Which ref do you want to rewrite?" if existed another branch
or tag, which name was 'branch-something' or 'something/branch'.
[jc: original report and fix were done between Dmitry Potapov
and Dscho; I rewrote it using "rev-parse --symbolic-full-name"]
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-filter-branch.sh | patch | blob | history |
diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index ae29f47e41cde04599c22603173c8aaa4ef533d9..ebf05ca600739fcb8103dcebc6b9172eebfdacca 100755 (executable)
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
GIT_WORK_TREE=.
export GIT_DIR GIT_WORK_TREE
-# These refs should be updated if their heads were rewritten
-
-git rev-parse --revs-only --symbolic "$@" |
-while read ref
-do
- # normalize ref
- case "$ref" in
- HEAD)
- ref="$(git symbolic-ref "$ref")"
- ;;
- refs/*)
- ;;
- *)
- ref="$(git for-each-ref --format='%(refname)' |
- grep /"$ref")"
- esac
-
- git check-ref-format "$ref" && echo "$ref"
-done > "$tempdir"/heads
+# The refs should be updated if their heads were rewritten
+git rev-parse --no-flags --revs-only --symbolic-full-name "$@" |
+sed -e '/^^/d' >"$tempdir"/heads
test -s "$tempdir"/heads ||
die "Which ref do you want to rewrite?"