Skip to content

Commit e2d7419

Browse files
greenfoogitster
authored andcommitted
mergetools: vimdiff: fix layout where REMOTE is the target
"mergetool.vimdiff.layout" is used to define the vim layout (ie. how windows, tabs and buffers are physically organized) when resolving conflicts. For example, if we set it to this: "(LOCAL,BASE,REMOTE)/MERGED" ...vim will open and show this layout: ------------------------------------------ | | | | | LOCAL | BASE | REMOTE | | | | | ------------------------------------------ | | | MERGED | | | ------------------------------------------ By default, whatever ends up been written to the "MERGED" window will become the file which conflict we are resolving. However, it is possible to use the "@" symbol to specify a different one. For example, if we use this slightly different version of the previously used string: "(LOCAL,BASE,@Remote)/MERGED" ...then the user should proceed to edit the contents of the top right window (instead of the bottom window) as *that* is what will become the conflicts free file once vim is closed. Before this commit, the "@" marker worked for all targets *except* for "REMOTE". In other words, these worked as expected: "(@Local,BASE,REMOTE)/MERGED" "(LOCAL,@base,REMOTE)/MERGED" "(LOCAL,BASE,REMOTE)/@merged" ...but this didn't: "(LOCAL,BASE,@Remote)/MERGED" This commit fixes that. Reported-by: kawarimidoll <[email protected]> Suggested-by: D. Ben Knoble <[email protected]> Signed-off-by: Fernando Ramos <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5c21db3 commit e2d7419

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mergetools/vimdiff

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,9 @@ gen_cmd () {
305305
elif echo "$LAYOUT" | grep @BASE >/dev/null
306306
then
307307
FINAL_TARGET="BASE"
308+
elif echo "$LAYOUT" | grep @REMOTE >/dev/null
309+
then
310+
FINAL_TARGET="REMOTE"
308311
else
309312
FINAL_TARGET="MERGED"
310313
fi

0 commit comments

Comments
 (0)