summaryrefslogtreecommitdiff
path: root/git-rebase--interactive.sh
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2016-11-21 15:18:29 +0100
committerJunio C Hamano <gitster@pobox.com>2016-11-21 11:00:41 -0800
commit882cd23777f8984e433e0c0addae5e9d70de75e8 (patch)
treeb20cadd5fcccd7543ac7087337611421d0064d00 /git-rebase--interactive.sh
parent92068ae8bf5711b683a0dbeef75d76f56ead5590 (diff)
downloadgit-882cd23777f8984e433e0c0addae5e9d70de75e8.tar.gz
rebase -i: handle core.commentChar=autojs/rebase-i-commentchar-fix
When 84c9dc2 (commit: allow core.commentChar=auto for character auto selection, 2014-05-17) extended the core.commentChar functionality to allow for the value 'auto', it forgot that rebase -i was already taught to handle core.commentChar, and in turn forgot to let rebase -i handle that new value gracefully. Reported by Taufiq Hoven. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-rebase--interactive.sh')
-rw-r--r--git-rebase--interactive.sh13
1 files changed, 11 insertions, 2 deletions
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 655ebaa471..c167bc36b3 100644
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -93,8 +93,17 @@ eval '
GIT_CHERRY_PICK_HELP="$resolvemsg"
export GIT_CHERRY_PICK_HELP
-comment_char=$(git config --get core.commentchar 2>/dev/null | cut -c1)
-: ${comment_char:=#}
+comment_char=$(git config --get core.commentchar 2>/dev/null)
+case "$comment_char" in
+'' | auto)
+ comment_char="#"
+ ;;
+?)
+ ;;
+*)
+ comment_char=$(echo "$comment_char" | cut -c1)
+ ;;
+esac
warn () {
printf '%s\n' "$*" >&2