[RFC/PATCH] stash: Delete MERGE_RR before stash apply

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

The presence of a GIT_DIR/MERGE_RR file indicates we
were resolving a merge which had rerere candidates for
recording.  But the file does not get deleted after
all resolutions are completed.  This is ok for most
cases because the file will get replaced when the
next merge happens.  But stash apply does not use
a merge that supports rerere, and so the old
MERGE_RR does not get replaced with a current one.

This then confuses mergetool who thinks a rerere
operation is in play when it is not.

Fix this by ensuring there is no leftover
MERGE_RR file whenever we are beginning a git stash

Signed-off-by: Phil Hord <hordp@xxxxxxxxx>

This feels like a hack and like it is in the wrong location.
However, the change is minimal and should fix my
specific problem[1].

[1] http://comments.gmane.org/gmane.comp.version-control.git/200178

 git-stash.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/git-stash.sh b/git-stash.sh
index 4e2c7f8..0b96e2f 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -409,6 +409,9 @@ apply_stash () {

        assert_stash_like "$@"

+       test -f "$GIT_DIR/MERGE_RR" &&
+               git rerere clear
        git update-index -q --refresh || die "$(gettext "unable to
refresh index")"

        # current index state
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Newbies FAQ]     [Linux Kernel Development]     [Free Online Dating]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Free Online Dating]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]     [Linux Resources]

Add to Google