2011-08-18 07:23:46 +00:00
|
|
|
diff_cmd () {
|
|
|
|
"$merge_tool_path" "$LOCAL" "$REMOTE"
|
|
|
|
}
|
|
|
|
|
|
|
|
merge_cmd () {
|
2011-08-19 09:14:45 +00:00
|
|
|
if test -z "${meld_has_output_option:+set}"
|
|
|
|
then
|
|
|
|
check_meld_for_output_version
|
|
|
|
fi
|
2011-08-18 07:23:46 +00:00
|
|
|
touch "$BACKUP"
|
2011-08-19 09:14:45 +00: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 07:23:46 +00:00
|
|
|
check_unchanged
|
|
|
|
}
|
2011-08-19 09:14:45 +00: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}"
|
|
|
|
|
2012-02-10 21:57:55 +00:00
|
|
|
if "$meld_path" --help 2>&1 | grep -e --output >/dev/null
|
2011-08-19 09:14:45 +00:00
|
|
|
then
|
|
|
|
meld_has_output_option=true
|
|
|
|
else
|
|
|
|
meld_has_output_option=false
|
|
|
|
fi
|
|
|
|
}
|