prompt=true
;;
-O*)
- orderfile="$1"
+ orderfile="${1#-O}"
;;
--)
shift
merge_keep_backup="$(git config --bool mergetool.keepBackup || echo true)"
merge_keep_temporaries="$(git config --bool mergetool.keepTemporaries || echo false)"
+ prefix=$(git rev-parse --show-prefix) || exit 1
+ cd_to_toplevel
+
+ if test -n "$orderfile"
+ then
+ orderfile=$(
+ git rev-parse --prefix "$prefix" -- "$orderfile" |
+ sed -e 1d
+ )
+ fi
+
if test $# -eq 0 && test -e "$GIT_DIR/MERGE_RR"
then
set -- $(git rerere remaining)
then
print_noop_and_exit
fi
+ elif test $# -ge 0
+ then
+ # rev-parse provides the -- needed for 'set'
+ eval "set $(git rev-parse --sq --prefix "$prefix" -- "$@")"
fi
files=$(git -c core.quotePath=false \
diff --name-only --diff-filter=U \
- ${orderfile:+"$orderfile"} -- "$@")
-
- cd_to_toplevel
+ ${orderfile:+"-O$orderfile"} -- "$@")
if test -z "$files"
then
printf "%s\n" "$files"
rc=0
- for i in $files
+ set -- $files
+ while test $# -ne 0
do
printf "\n"
- if ! merge_file "$i"
+ if ! merge_file "$1"
then
rc=1
- prompt_after_failed_merge || exit 1
+ test $# -ne 1 && prompt_after_failed_merge || exit 1
fi
+ shift
done
exit $rc