@matheusbsbs / matheus-bagliano / commits / f131dd492f
Fork 0

rerere: record (or avoid misrecording) resolved, skipped or aborted rebase/am

Data in rr-cache isn't valid after a patch application is skipped or and aborted, so our next commit could be misrecorded as a resolution of that skipped/failed commit, which is wrong. git-am --skip, git-rebase --skip/--abort will automatically invoke git-rerere clear to avoid this. Also, since git-am --resolved indicates a resolution was succesful, remember to run git-rerere to record the resolution (and not surprise the user when the next commit is made). Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>

Eric Wong committed Dec 8, 2006 at 13:29 UTC f131dd492f098f9f565df93df13e35c734284590
2 files changed +16
git-am.sh
+8
@@ -246,6 +246,10 @@ last=`cat "$dotest/last"`
246 this=`cat "$dotest/next"`
247 if test "$skip" = t
248 then
249 + if test -d "$GIT_DIR/rr-cache"
250 + then
251 + git-rerere clear
252 + fi
253 this=`expr "$this" + 1`
254 resume=
255 fi
@@ -408,6 +412,10 @@ do
412 stop_here_user_resolve $this
413 fi
414 apply_status=0
415 + if test -d "$GIT_DIR/rr-cache"
416 + then
417 + git rerere
418 + fi
419 ;;
420 esac
421
git-rebase.sh
+8
@@ -139,6 +139,10 @@ do
139 --skip)
140 if test -d "$dotest"
141 then
142 + if test -d "$GIT_DIR/rr-cache"
143 + then
144 + git-rerere clear
145 + fi
146 prev_head="`cat $dotest/prev_head`"
147 end="`cat $dotest/end`"
148 msgnum="`cat $dotest/msgnum`"
@@ -157,6 +161,10 @@ do
161 exit
162 ;;
163 --abort)
164 + if test -d "$GIT_DIR/rr-cache"
165 + then
166 + git-rerere clear
167 + fi
168 if test -d "$dotest"
169 then
170 rm -r "$dotest"