Skip to content
Browse files

Run re-search-forward for git diff with noerror=t.

This ensures the rest of git-commit-mode (e.g., run-mode-hooks) will
successfully run even if no git diff was found.

Signed-off-by: Adeodato Simó <>
  • Loading branch information...
1 parent 3e2d104 commit ec88948e06f787fcc1c3b9951930ef00b25d0b8a @dato committed Mar 1, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 git-commit.el
2 git-commit.el
@@ -513,7 +513,7 @@ NOTE defaults to `current-prefix-arg'."
"Add font lock on diff."
(goto-char (point-min))
- (when (re-search-forward "^diff --git")
+ (when (re-search-forward "^diff --git" nil t)
(let ((beg (match-beginning 0)))
(let* ((buffer (current-buffer))
(font-lock-verbose nil)

0 comments on commit ec88948

Please sign in to comment.
Something went wrong with that request. Please try again.