From ca96589764439e550a528b936e94d9b41f2912c2 Mon Sep 17 00:00:00 2001 From: Owen Griffin Date: Wed, 1 Apr 2015 21:29:32 +0100 Subject: [PATCH] Support Windows paths - Changes the current directory before commit - Quotes the filename arguments using shell-quote-argument --- git-auto-commit-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-auto-commit-mode.el b/git-auto-commit-mode.el index da6d01b..99ecd63 100644 --- a/git-auto-commit-mode.el +++ b/git-auto-commit-mode.el @@ -107,7 +107,7 @@ Default to FILENAME." (let* ((filename (buffer-file-name)) (commit-msg (gac--commit-msg filename))) (shell-command - (concat "git add '" filename "' && git commit -m '" commit-msg "'")))) + (concat "cd " (shell-quote-argument (convert-standard-filename (file-name-directory (buffer-file-name)))) " && git add " (shell-quote-argument (convert-standard-filename (file-name-nondirectory filename))) " && git commit -m '" commit-msg "'")))) (defun gac-push () "Push commits to the current upstream.