diff options
author | Alexandre Julliard <julliard@winehq.org> | 2007-08-22 14:21:38 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-08-23 02:29:08 +0400 |
commit | ef08c14993a8d2881941667c0264c97c6874ccee (patch) | |
tree | e6fe1a5e1317985a8e48967f14110e14fc80b2ad /contrib/emacs | |
parent | 2f5b3980617bd618ebb4314cadaff4e71ce2a390 (diff) |
git.el: Avoid a lisp error when there's no current branch (detached HEAD).
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/emacs')
-rw-r--r-- | contrib/emacs/git.el | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el index be44e06c45..abc799a287 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: " |