pathspec: copy and free owned memory
[gitweb.git] / git-rebase--interactive.sh
index ca994c5c545cb0394fc5d355ecb6ea2fe5f1f193..41fd374c725de1f42965b829c2bed5c48c92e19c 100644 (file)
@@ -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