Don't commit if not inside a Git work tree

Prevents committing files inside `.git`, such as the `.git/rebase-merge/git-rebase-todo`.
This commit is contained in:
Robert Irelan 2019-05-02 12:02:57 -07:00 committed by Robert Irelan
parent 309c610e39
commit 848374379a

View file

@ -341,7 +341,11 @@ should already have been set up."
(when (and (buffer-live-p buffer)
(or (and gac-automatically-add-new-files-p
(not (gac--buffer-is-tracked buffer)))
(gac--buffer-has-changes buffer)))
(gac--buffer-has-changes buffer))
(string=
"true\n"
(gac--shell-command-to-string-throw
"git rev-parse --is-inside-work-tree")))
(gac-commit buffer)
(gac-merge buffer)
(with-current-buffer buffer