aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorAlexandre Julliard <julliard@winehq.org>2007-08-22 12:21:38 +0200
committerJunio C Hamano <gitster@pobox.com>2007-08-22 15:29:08 -0700
commitef08c14993a8d2881941667c0264c97c6874ccee (patch)
treee6fe1a5e1317985a8e48967f14110e14fc80b2ad /contrib
parent2f5b3980617bd618ebb4314cadaff4e71ce2a390 (diff)
downloadgit-ef08c14993a8d2881941667c0264c97c6874ccee.tar.gz
git-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>
Diffstat (limited to 'contrib')
-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 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: "