diff options
author | Kyle Meyer <kyle@kyleam.com> | 2022-12-26 18:04:59 -0500 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2024-01-22 00:02:53 -0500 |
commit | ff623acacf508f4356a601fe304dfab18637f3a4 (patch) | |
tree | 08b38c40320c0fcd173e498a195bc59e0dff8663 /lisp | |
parent | de83751ba7df571e181a7c1ecc3cc75e9fcc8683 (diff) | |
download | emacs.d-ff623acacf508f4356a601fe304dfab18637f3a4.tar.gz |
km/magit-insert-staged-file: Strip directory by default
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/km-magit.el | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lisp/km-magit.el b/lisp/km-magit.el index 08ddd06..92ba112 100644 --- a/lisp/km-magit.el +++ b/lisp/km-magit.el @@ -469,13 +469,13 @@ N defaults to 20." (1 (car files)) (t (magit-completing-read "File" files nil t)))))) -(defun km/magit-insert-staged-file (&optional no-directory) +(defun km/magit-insert-staged-file (&optional full-name) "Select a staged file to insert. This is useful for referring to file names in commit messages. By default, the path for the file name is relative to the top directory of the repository. Remove the directory component from -the file name if NO-DIRECTORY is non-nil. +the file name unless FULL-NAME is non-nil. If there are no staged files, look instead at files that changed in HEAD. These rules will usually offer the files of interest @@ -491,7 +491,7 @@ command will still offer the staged files)." (0 (error "No files found")) (t (completing-read "Staged file: " files nil t))))) - (insert (if no-directory (file-name-nondirectory file) file))))) + (insert (if full-name file (file-name-nondirectory file)))))) (defun km/magit-shorten-hash (hash &optional n) (magit-rev-parse (format "--short=%s" (or n (magit-abbrev-length))) hash)) |