mirror of
https://github.com/git/git
synced 2024-10-28 19:25:47 +00:00
Merge branch 'da/mergetools-p4' into maint
"git mergetool" feeds /dev/null as a common ancestor when dealing with an add/add conflict, but p4merge backend cannot handle it. Work it around by passing a temporary empty file. * da/mergetools-p4: mergetools/p4merge: Handle "/dev/null"
This commit is contained in:
commit
6c95f535e9
1 changed files with 25 additions and 0 deletions
|
@ -1,5 +1,30 @@
|
||||||
diff_cmd () {
|
diff_cmd () {
|
||||||
|
# p4merge does not like /dev/null
|
||||||
|
rm_local=
|
||||||
|
rm_remote=
|
||||||
|
if test "/dev/null" = "$LOCAL"
|
||||||
|
then
|
||||||
|
LOCAL="./p4merge-dev-null.LOCAL.$$"
|
||||||
|
>"$LOCAL"
|
||||||
|
rm_local=true
|
||||||
|
fi
|
||||||
|
if test "/dev/null" = "$REMOTE"
|
||||||
|
then
|
||||||
|
REMOTE="./p4merge-dev-null.REMOTE.$$"
|
||||||
|
>"$REMOTE"
|
||||||
|
rm_remote=true
|
||||||
|
fi
|
||||||
|
|
||||||
"$merge_tool_path" "$LOCAL" "$REMOTE"
|
"$merge_tool_path" "$LOCAL" "$REMOTE"
|
||||||
|
|
||||||
|
if test -n "$rm_local"
|
||||||
|
then
|
||||||
|
rm -f "$LOCAL"
|
||||||
|
fi
|
||||||
|
if test -n "$rm_remote"
|
||||||
|
then
|
||||||
|
rm -f "$REMOTE"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
merge_cmd () {
|
merge_cmd () {
|
||||||
|
|
Loading…
Reference in a new issue