summaryrefslogtreecommitdiff
path: root/git-rebase--interactive.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2016-11-23 11:23:17 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-11-23 11:23:17 -0800
commitbd53f38d52b87340ad791290d700c5c7e8587f23 (patch)
treeecff6137224ddcd8d0e20a9a7c68fec94f056841 /git-rebase--interactive.sh
parentMerge branch 'jc/for-each-ref-head-segfault-fix' (diff)
parentrebase -i: handle core.commentChar=auto (diff)
downloadtgif-bd53f38d52b87340ad791290d700c5c7e8587f23.tar.xz
Merge branch 'js/rebase-i-commentchar-fix'
"git rebase -i" did not work well with core.commentchar configuration variable for two reasons, both of which have been fixed. * js/rebase-i-commentchar-fix: rebase -i: handle core.commentChar=auto stripspace: respect repository config rebase -i: highlight problems with core.commentchar
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 ca994c5c54..41fd374c72 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