From 8cc37dcb99abee8dd83481500b81e2aa32e985a2 Mon Sep 17 00:00:00 2001 From: Nathan Weizenbaum Date: Thu, 17 Jun 2010 01:57:28 -0700 Subject: [PATCH] Fix ref ambiguity detection. --- magit.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/magit.el b/magit.el index b2080531..1d54f9bb 100644 --- a/magit.el +++ b/magit.el @@ -510,7 +510,9 @@ return nil." (defun magit-ref-ambiguous-p (ref) "Return whether or not REF is ambiguous." - (/= (magit-git-exit-code "rev-parse" "--abbrev-ref" ref) 0)) + ;; If REF is ambiguous, rev-parse just prints errors, + ;; so magit-git-string returns nil. + (not (magit-git-string "rev-parse" "--abbrev-ref" ref))) (defun magit-name-rev (rev) "Return a human-readable name for REV.