From: Alexandre Julliard Date: Wed, 22 Aug 2007 10:21:38 +0000 (+0200) Subject: git.el: Avoid a lisp error when there's no current branch (detached HEAD). X-Git-Tag: v1.5.3-rc7~41 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ef08c14993a8d2881941667c0264c97c6874ccee;p=git.git git.el: Avoid a lisp error when there's no current branch (detached HEAD). Signed-off-by: Alexandre Julliard Signed-off-by: Junio C Hamano --- diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el index be44e06c4..abc799a28 100644 --- a/contrib/emacs/git.el +++ b/contrib/emacs/git.el @@ -664,9 +664,11 @@ Return the list of files that haven't been handled." (ewoc-set-hf status (format "Directory: %s\nBranch: %s\nHead: %s%s\n" default-directory - (if (string-match "^refs/heads/" branch) - (substring branch (match-end 0)) - branch) + (if branch + (if (string-match "^refs/heads/" branch) + (substring branch (match-end 0)) + branch) + "none (detached HEAD)") head (if merge-heads (concat "\nMerging: "