Re: [PATCH v2] Bisect reset: remove bisect refs that may have been packed.
Christian Couder <chriscool@tuxfamily.org> writes:
Show 7 quoted lines
> If refs were ever packed in the middle of bisection, the bisect
> refs were not removed from the "packed-refs" file.
>
> This patch fixes this problem by using "git update-ref -d $ref $hash"
> in "bisect_clean_state".
>
> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Thanks. Just a few nits.
On top of your patch...
- You forgot to remove one "removal of filesystem refs";
- for-each-ref takes more than one patterns.
git-bisect.sh | 9 ++-------
1 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/git-bisect.sh b/git-bisect.sh
index 584906f..21ed02f 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -350,17 +350,12 @@ bisect_reset() {
}
bisect_clean_state() {
- rm -fr "$GIT_DIR/refs/bisect"
-
# There may be some refs packed during bisection.
- git for-each-ref --format='%(refname) %(objectname)' \
- "refs/bisect/*" | while read ref hash
+ git for-each-ref --format='%(refname) %(objectname)' refs/bisect/\* refs/heads/bisect |
+ while read ref hash
do
git update-ref -d $ref $hash
done
-
- hash=$(git show-ref --hash refs/heads/bisect)
- test -n "$hash" && git update-ref -d refs/heads/bisect $hash
rm -f "$GIT_DIR/BISECT_LOG"
rm -f "$GIT_DIR/BISECT_NAMES"
rm -f "$GIT_DIR/BISECT_RUN"