summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2015-09-15 00:31:08 -0400
committerKyle Meyer <kyle@kyleam.com>2015-09-15 00:31:14 -0400
commitf2288fe8d519eab3fc6461f96ed03eee1cf2eb73 (patch)
treec8c6debccf34e305b9c9cbee84815dc71a4a408c
parent9a5adfd37e66e1e6fdb3473c21d4b7c86aeaed3c (diff)
downloademacs.d-f2288fe8d519eab3fc6461f96ed03eee1cf2eb73.tar.gz
magit-commit-{wip,extend}-with-file: allow untracked
-rw-r--r--lisp/init-git.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/init-git.el b/lisp/init-git.el
index 0b13be2..a5fb2c9 100644
--- a/lisp/init-git.el
+++ b/lisp/init-git.el
@@ -74,7 +74,8 @@ CHOOSE-PROJECT is non-nil, prompt for the project name."
(user-error "No current file"))))
(cond ((magit-anything-staged-p)
(user-error "There are already staged changes"))
- ((member file (magit-modified-files))
+ ((member file (nconc (magit-untracked-files)
+ (magit-modified-files)))
(magit-with-toplevel (magit-stage-file file))
(magit-commit-extend))
(t
@@ -89,7 +90,8 @@ branch."
(user-error "No current file"))))
(cond ((magit-anything-staged-p)
(user-error "There are already staged changes"))
- ((member file (magit-modified-files))
+ ((member file (nconc (magit-untracked-files)
+ (magit-modified-files)))
(magit-with-toplevel (magit-stage-file file))
(magit-run-git "commit" (concat "--message=WIP " file)))
(t