Permalink
Browse files

stgit.el: Stop stgit-rename from causing error on no change

Signed-off-by: Gustav Hållberg <gustav@gmail.com>
  • Loading branch information...
1 parent e93b64d commit fe221c1b549ad6fc4f0807e0c862da8e29af4d91 @Gustavigator Gustavigator committed Apr 6, 2012
Showing with 12 additions and 11 deletions.
  1. +12 −11 contrib/stgit.el
View
@@ -1874,17 +1874,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))
@dkagedal

dkagedal Apr 8, 2012

Indentation again. Or is it github that is having problems?

@gustavh

gustavh Apr 9, 2012

Owner

Tabs again…

+ (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').

0 comments on commit fe221c1

Please sign in to comment.