summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Alexandre Julliard <julliard@winehq.org>2007-08-22 12:21:38 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2007-08-22 15:29:08 -0700
commitef08c14993a8d2881941667c0264c97c6874ccee (patch)
treee6fe1a5e1317985a8e48967f14110e14fc80b2ad
parentFix git-remote for ActiveState Perl (diff)
downloadtgif-ef08c14993a8d2881941667c0264c97c6874ccee.tar.xz
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>
-rw-r--r--contrib/emacs/git.el8
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: "