aboutsummaryrefslogtreecommitdiff
path: root/git-rebase--interactive.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-11-23 11:23:17 -0800
committerJunio C Hamano <gitster@pobox.com>2016-11-23 11:23:17 -0800
commitbd53f38d52b87340ad791290d700c5c7e8587f23 (patch)
treeecff6137224ddcd8d0e20a9a7c68fec94f056841 /git-rebase--interactive.sh
parent48e9ad5ef3afd39168e2fb72d0ce7ac5f7124d31 (diff)
parent882cd23777f8984e433e0c0addae5e9d70de75e8 (diff)
downloadgit-bd53f38d52b87340ad791290d700c5c7e8587f23.tar.gz
git-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 ca994c5c5..41fd374c7 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