提交 cda8ab59 编写于 作者: J Jeff King 提交者: Junio C Hamano

git-commit: allow -e option anywhere on command line

Previously, the command 'git-commit -e -m foo' would ignore the '-e' option
because the '-m' option overwrites the no_edit flag during sequential
option parsing. Now we cause -e to reset the no_edit flag after all
options are parsed.
Signed-off-by: NJeff King <peff@peff.net>
Signed-off-by: NJunio C Hamano <junkio@cox.net>
上级 8d3cbd27
...@@ -199,6 +199,7 @@ only= ...@@ -199,6 +199,7 @@ only=
logfile= logfile=
use_commit= use_commit=
amend= amend=
edit_flag=
no_edit= no_edit=
log_given= log_given=
log_message= log_message=
...@@ -246,7 +247,7 @@ do ...@@ -246,7 +247,7 @@ do
shift shift
;; ;;
-e|--e|--ed|--edi|--edit) -e|--e|--ed|--edi|--edit)
no_edit= edit_flag=t
shift shift
;; ;;
-i|--i|--in|--inc|--incl|--inclu|--includ|--include) -i|--i|--in|--inc|--incl|--inclu|--includ|--include)
...@@ -384,6 +385,7 @@ $1" ...@@ -384,6 +385,7 @@ $1"
;; ;;
esac esac
done done
case "$edit_flag" in t) no_edit= ;; esac
################################################################ ################################################################
# Sanity check options # Sanity check options
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册