summaryrefslogtreecommitdiff
path: root/git-gui/lib/commit.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'git-gui/lib/commit.tcl')
-rw-r--r--git-gui/lib/commit.tcl4
1 files changed, 3 insertions, 1 deletions
diff --git a/git-gui/lib/commit.tcl b/git-gui/lib/commit.tcl
index 208dc2817c..a570f9cdc6 100644
--- a/git-gui/lib/commit.tcl
+++ b/git-gui/lib/commit.tcl
@@ -211,7 +211,9 @@ You must stage at least 1 file before you can commit.
# Strip trailing whitespace
regsub -all -line {[ \t\r]+$} $msg {} msg
# Strip comment lines
- regsub -all {(^|\n)#[^\n]*} $msg {\1} msg
+ global comment_string
+ set cmt_rx [strcat {(^|\n)} [regsub -all {\W} $comment_string {\\&}] {[^\n]*}]
+ regsub -all $cmt_rx $msg {\1} msg
# Strip leading empty lines
regsub {^\n*} $msg {} msg
# Compress consecutive empty lines