Permalink
Browse files

Don't use find-if

  • Loading branch information...
1 parent 59371ab commit 1dbbcd5378ffc0b40c25e8d5f7b597ccc09440bb @kidd committed Nov 20, 2012
Showing with 6 additions and 4 deletions.
  1. +6 −4 magit.el
View
@@ -27,6 +27,7 @@
;; Copyright (C) 2009, 2010 Phil Jackson.
;; Copyright (C) 2010 Philip Weaver.
;; Copyright (C) 2010 Ramkumar Ramachandra.
+;; Copyright (C) 2012 Raimon Grau.
;; Copyright (C) 2010 Remco van 't Veer.
;; Copyright (C) 2009 René Stadler.
;; Copyright (C) 2010 Robin Green.
@@ -3889,10 +3890,11 @@ With prefix, forces the move even if NEW already exists.
(magit-section-info (magit-section-parent item)))
((commit) (magit-name-rev (substring info 0 magit-sha1-abbrev-length)))
((wazzup) info)
- (t (match-string 1 (find-if
- (lambda (x)
- (string-match "moving from \\(.*\\) to" x))
- (magit-git-lines "reflog"))))))
+ (t (let ((lines (magit-git-lines "reflog")))
+ (while (not (string-match "moving from \\(.*\\) to" (car lines)))
+ (setq lines (cdr lines)))
+ (when lines
+ (match-string 1 (car lines)))))))
;;; Remotes

0 comments on commit 1dbbcd5

Please sign in to comment.