2011-08-18 09:23:46 +02:00
|
|
|
diff_cmd () {
|
|
|
|
"$merge_tool_path" "$LOCAL" "$REMOTE"
|
|
|
|
}
|
|
|
|
|
|
|
|
merge_cmd () {
|
2011-08-19 11:14:45 +02:00
|
|
|
if test -z "${meld_has_output_option:+set}"
|
|
|
|
then
|
|
|
|
check_meld_for_output_version
|
|
|
|
fi
|
2011-08-18 09:23:46 +02:00
|
|
|
touch "$BACKUP"
|
2011-08-19 11:14:45 +02:00
|
|
|
if test "$meld_has_output_option" = true
|
|
|
|
then
|
|
|
|
"$merge_tool_path" --output "$MERGED" \
|
|
|
|
"$LOCAL" "$BASE" "$REMOTE"
|
|
|
|
else
|
|
|
|
"$merge_tool_path" "$LOCAL" "$MERGED" "$REMOTE"
|
|
|
|
fi
|
2011-08-18 09:23:46 +02:00
|
|
|
check_unchanged
|
|
|
|
}
|
2011-08-19 11:14:45 +02:00
|
|
|
|
|
|
|
# Check whether 'meld --output <file>' is supported
|
|
|
|
check_meld_for_output_version () {
|
|
|
|
meld_path="$(git config mergetool.meld.path)"
|
|
|
|
meld_path="${meld_path:-meld}"
|
|
|
|
|
|
|
|
if "$meld_path" --output /dev/null --help >/dev/null 2>&1
|
|
|
|
then
|
|
|
|
meld_has_output_option=true
|
|
|
|
else
|
|
|
|
meld_has_output_option=false
|
|
|
|
fi
|
|
|
|
}
|