aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustav Hållberg <gustav@gmail.com>2012-04-06 21:32:39 +0200
committerGustav Hållberg <gustav@gmail.com>2012-04-09 09:23:27 +0200
commit5b2c8ada74be27dab932108c69f08a7436e9c258 (patch)
tree0cd5b87a8e715291428875b3048f670e73e63f8d
parent7347eb884eff4321df0b8237f24e9dd44b926e4a (diff)
downloadstgit-5b2c8ada74be27dab932108c69f08a7436e9c258.tar.gz
stgit.el: Stop stgit-rename from causing error on no change
Signed-off-by: Gustav Hållberg <gustav@gmail.com>
-rw-r--r--contrib/stgit.el23
1 files changed, 12 insertions, 11 deletions
diff --git a/contrib/stgit.el b/contrib/stgit.el
index 17a9da6..0bc0729 100644
--- a/contrib/stgit.el
+++ b/contrib/stgit.el
@@ -1876,17 +1876,18 @@ line of PATCHSYM and return :patch."
(symbol-name (stgit-patch-name-at-point t t)))))
(stgit-assert-mode)
(let ((old-patchsym (stgit-patch-name-at-point t t)))
- (stgit-capture-output nil
- (stgit-run "rename" "--" old-patchsym name))
- (let ((name-sym (intern name)))
- (when (memq old-patchsym stgit-expanded-patches)
- (setq stgit-expanded-patches
- (cons name-sym (delq old-patchsym stgit-expanded-patches))))
- (when (memq old-patchsym stgit-marked-patches)
- (setq stgit-marked-patches
- (cons name-sym (delq old-patchsym stgit-marked-patches))))
- (stgit-reload)
- (stgit-goto-patch name-sym))))
+ (unless (string-equal (symbol-name old-patchsym) name)
+ (stgit-capture-output nil
+ (stgit-run "rename" "--" old-patchsym name))
+ (let ((name-sym (intern name)))
+ (when (memq old-patchsym stgit-expanded-patches)
+ (setq stgit-expanded-patches
+ (cons name-sym (delq old-patchsym stgit-expanded-patches))))
+ (when (memq old-patchsym stgit-marked-patches)
+ (setq stgit-marked-patches
+ (cons name-sym (delq old-patchsym stgit-marked-patches))))
+ (stgit-reload)
+ (stgit-goto-patch name-sym)))))
(defun stgit-reload-or-repair (repair)
"Update the contents of the StGit buffer (`stgit-reload').