From: Alexandre Julliard <julliard@winehq.org>
To: git@vger.kernel.org
Subject: [PATCH] git.el: Avoid a lisp error when there's no current branch (detached HEAD).
Date: Wed, 22 Aug 2007 12:21:38 +0200 [thread overview]
Message-ID: <87r6lvna31.fsf@wine.dyndns.org> (raw)
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
---
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 be44e06..abc799a 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: "
--
1.5.3.rc6.12.g7c176
--
Alexandre Julliard
julliard@winehq.org
reply other threads:[~2007-08-22 10:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r6lvna31.fsf@wine.dyndns.org \
--to=julliard@winehq.org \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).