{"thread":{"id":"10071","subject":"[PATCH 4/4] git.el: Reset the permission flags when changing a file state.","startedAt":"2007-09-29T09:59:32Z","lastAt":"2007-09-29T09:59:32Z","messageCount":1,"participants":["Alexandre Julliard"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"54325","messageId":"87y7epokqj.fsf@wine.dyndns.org","threadId":"10071","inReplyTo":null,"subject":"[PATCH 4/4] git.el: Reset the permission flags when changing a file state.","fromName":"Alexandre Julliard","fromEmail":"julliard@winehq.org","sentAt":"2007-09-29T09:59:32Z","receivedAt":"2007-09-29T09:59:32Z","isPatch":true,"sender":{"key":"julliard@winehq.org","avatar":null},"body":"Signed-off-by: Alexandre Julliard <julliard@winehq.org>\n---\n contrib/emacs/git.el |   28 +++++++++++-----------------\n 1 files changed, 11 insertions(+), 17 deletions(-)\n\ndiff --git a/contrib/emacs/git.el b/contrib/emacs/git.el\nindex c2a1c3d..4286d16 100644\n--- a/contrib/emacs/git.el\n+++ b/contrib/emacs/git.el\n@@ -484,14 +484,15 @@ and returns the process output as a string.\"\n   \"Remove everything from the status list.\"\n   (ewoc-filter status (lambda (info) nil)))\n \n-(defun git-set-files-state (files state)\n-  \"Set the state of a list of files.\"\n-  (dolist (info files)\n-    (unless (eq (git-fileinfo->state info) state)\n-      (setf (git-fileinfo->state info) state)\n-      (setf (git-fileinfo->rename-state info) nil)\n-      (setf (git-fileinfo->orig-name info) nil)\n-      (setf (git-fileinfo->needs-refresh info) t))))\n+(defun git-set-fileinfo-state (info state)\n+  \"Set the state of a file info.\"\n+  (unless (eq (git-fileinfo->state info) state)\n+    (setf (git-fileinfo->state info) state\n+          (git-fileinfo->old-perm info) 0\n+          (git-fileinfo->new-perm info) 0\n+          (git-fileinfo->rename-state info) nil\n+          (git-fileinfo->orig-name info) nil\n+          (git-fileinfo->needs-refresh info) t)))\n \n (defun git-status-filenames-map (status func files &rest args)\n   \"Apply FUNC to the status files names in the FILES list.\"\n@@ -510,14 +511,7 @@ and returns the process output as a string.\"\n (defun git-set-filenames-state (status files state)\n   \"Set the state of a list of named files.\"\n   (when files\n-    (git-status-filenames-map status\n-                              (lambda (info state)\n-                                (unless (eq (git-fileinfo->state info) state)\n-                                  (setf (git-fileinfo->state info) state)\n-                                  (setf (git-fileinfo->rename-state info) nil)\n-                                  (setf (git-fileinfo->orig-name info) nil)\n-                                  (setf (git-fileinfo->needs-refresh info) t)))\n-                              files state)\n+    (git-status-filenames-map status #'git-set-fileinfo-state files state)\n     (unless state  ;; delete files whose state has been set to nil\n       (ewoc-filter status (lambda (info) (git-fileinfo->state info))))))\n \n@@ -800,7 +794,7 @@ Return the list of files that haven't been handled.\"\n                             (condition-case nil (delete-file \".git/MERGE_HEAD\") (error nil))\n                             (condition-case nil (delete-file \".git/MERGE_MSG\") (error nil))\n                             (with-current-buffer buffer (erase-buffer))\n-                            (git-set-files-state files 'uptodate)\n+                            (dolist (info files) (git-set-fileinfo-state info 'uptodate))\n                             (git-call-process-env nil nil \"rerere\")\n                             (git-refresh-files)\n                             (git-refresh-ewoc-hf git-status)\n-- \n1.5.3.2.121.gf7223\n\n-- \nAlexandre Julliard\njulliard@winehq.org\n"}]}