summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/km-magit.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/km-magit.el b/lisp/km-magit.el
index 95ce2a7..1f9caa9 100644
--- a/lisp/km-magit.el
+++ b/lisp/km-magit.el
@@ -57,12 +57,14 @@ a proper commit."
(cl-case (length files)
(0 (user-error "No tracked files with changes"))
(1
- (magit-run-git "commit" "--all" "--message"
- (concat (funcall (if no-directory
- #'file-name-nondirectory
- #'identity)
- (car files))
- ": Update")))
+ (let ((file (car files)))
+ (magit-run-git "commit" "--all" "--message"
+ (concat (funcall (if no-directory
+ #'file-name-nondirectory
+ #'identity)
+ file)
+ (and (magit-rev-verify (concat "HEAD:" file))
+ ": Update")))))
(t
(km/magit-auto-commit)))))