提交 f22fd75c 编写于 作者: J Junio C Hamano

git-diff: do not fall back on --cc when -[123], --ours etc. are given.

These flags ask diff with a specific unmerged stage, so it
should fall back on -p instead.  Also when -c is given, we
should not do --cc.
Signed-off-by: NJunio C Hamano <junkio@cox.net>
上级 a2c641c4
......@@ -22,14 +22,23 @@ case "$rev" in
esac
esac
# If we do not have --name-status, --name-only nor -r, default to --cc.
# If we do not have -B nor -C, default to -M.
# If we have -[123] --ours --theirs --base, don't do --cc by default.
case " $flags " in
*" '--name-status' "* | *" '--name-only' "* | *" '-r' "* )
*" '-"[123]"' "* | *" '--ours' "* | *" '--base' "* | *" '--theirs' "*)
cc_or_p=-p ;;
*)
cc_or_p=--cc ;;
esac
# If we do not have --name-status, --name-only, -r, or -c default to --cc.
case " $flags " in
*" '--name-status' "* | *" '--name-only' "* | *" '-r' "* | *" '-c' "* )
;;
*)
flags="$flags'--cc' " ;;
flags="$flags'$cc_or_p' " ;;
esac
# If we do not have -B nor -C, default to -M.
case " $flags " in
*" '-"[BCM]* | *" '--find-copies-harder' "*)
;; # something like -M50.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册