diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-11-03 15:32:30 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-11-03 15:32:30 -0800 |
commit | c04b3a2dbff67605078139f97d4546716e4a1f40 (patch) | |
tree | 731b606c724015edc2169ec153472bd67fc9639c /git-rebase--interactive.sh | |
parent | Merge branch 'js/clone-dissociate' into maint (diff) | |
parent | rebase-i: work around Windows CRLF line endings (diff) | |
download | tgif-c04b3a2dbff67605078139f97d4546716e4a1f40.tar.xz |
Merge branch 'gr/rebase-i-drop-warn' into maint
Recent update to "rebase -i" that tries to sanity check the edited
insn sheet before it uses it has become too picky on Windows where
CRLF left by the editor is turned into a trailing CR on the line
read via the "read" built-in command.
* gr/rebase-i-drop-warn:
rebase-i: work around Windows CRLF line endings
t3404: "rebase -i" gets broken when insn sheet uses CR/LF line endings
Diffstat (limited to 'git-rebase--interactive.sh')
-rw-r--r-- | git-rebase--interactive.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index d65c06eff3..30edb17925 100644 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -77,6 +77,10 @@ amend="$state_dir"/amend rewritten_list="$state_dir"/rewritten-list rewritten_pending="$state_dir"/rewritten-pending +# Work around Git for Windows' Bash whose "read" does not strip CRLF +# and leaves CR at the end instead. +cr=$(printf "\015") + strategy_args= if test -n "$do_merge" then @@ -518,6 +522,10 @@ do_next () { "$comment_char"*|''|noop|drop|d) mark_action_done ;; + "$cr") + # Work around CR left by "read" (e.g. with Git for Windows' Bash). + mark_action_done + ;; pick|p) comment_for_reflog pick @@ -896,6 +904,10 @@ check_bad_cmd_and_sha () { "$comment_char"*|''|noop|x|exec) # Doesn't expect a SHA-1 ;; + "$cr") + # Work around CR left by "read" (e.g. with Git for + # Windows' Bash). + ;; pick|p|drop|d|reword|r|edit|e|squash|s|fixup|f) if ! check_commit_sha "${rest%%[ ]*}" "$lineno" "$1" then |