summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2022-07-24 12:09:50 -0400
committerKyle Meyer <kyle@kyleam.com>2022-11-26 21:45:14 -0500
commitc3f9c79293c93b7b01645ba48a01dfb453beed63 (patch)
tree7c922872d18eaadab369865844132ba5cba5c92e /lisp
parent7b1c321f65a74fa226f29e7f40a9cbfb6ae8dc7c (diff)
downloademacs.d-c3f9c79293c93b7b01645ba48a01dfb453beed63.tar.gz
km/magit-update-or-auto-commit: Improve message for new file
Diffstat (limited to 'lisp')
-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)))))