stgit.el: Bugfix moving symlinks to/from index
authorGustav Hållberg <gustav@virtutech.com>
Sat, 1 Aug 2009 21:07:43 +0000 (23:07 +0200)
committerGustav Hållberg <gustav@virtutech.com>
Mon, 3 Aug 2009 13:59:09 +0000 (15:59 +0200)
Signed-off-by: Gustav Hållberg <gustav@virtutech.com>
contrib/stgit.el

index 65fe68a..c4ed958 100644 (file)
@@ -878,7 +878,8 @@ If PATCHSYM is a keyword, returns PATCHSYM unmodified."
 
 (defun stgit-move-change-to-index (file)
   "Copies the workspace state of FILE to index, using git add or git rm"
-  (let ((op (if (file-exists-p file) '("add") '("rm" "-q"))))
+  (let ((op (if (or (file-exists-p file) (file-symlink-p file))
+                '("add") '("rm" "-q"))))
     (stgit-capture-output "*git output*"
       (apply 'stgit-run-git (append op '("--") (list file))))))