{"thread":{"id":"9608","subject":"[PATCH] git.el: Avoid a lisp error when there's no current branch (detached HEAD).","startedAt":"2007-08-22T10:21:38Z","lastAt":"2007-08-22T10:21:38Z","messageCount":1,"participants":["Alexandre Julliard"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"51238","messageId":"87r6lvna31.fsf@wine.dyndns.org","threadId":"9608","inReplyTo":null,"subject":"[PATCH] git.el: Avoid a lisp error when there's no current branch (detached HEAD).","fromName":"Alexandre Julliard","fromEmail":"julliard@winehq.org","sentAt":"2007-08-22T10:21:38Z","receivedAt":"2007-08-22T10:21:38Z","isPatch":true,"sender":{"key":"julliard@winehq.org","avatar":null},"body":"Signed-off-by: Alexandre Julliard <julliard@winehq.org>\n---\n contrib/emacs/git.el |    8 +++++---\n 1 files changed, 5 insertions(+), 3 deletions(-)\n\ndiff --git a/contrib/emacs/git.el b/contrib/emacs/git.el\nindex be44e06..abc799a 100644\n--- a/contrib/emacs/git.el\n+++ b/contrib/emacs/git.el\n@@ -664,9 +664,11 @@ Return the list of files that haven't been handled.\"\n     (ewoc-set-hf status\n                  (format \"Directory:  %s\\nBranch:     %s\\nHead:       %s%s\\n\"\n                          default-directory\n-                         (if (string-match \"^refs/heads/\" branch)\n-                             (substring branch (match-end 0))\n-                           branch)\n+                         (if branch\n+                             (if (string-match \"^refs/heads/\" branch)\n+                                 (substring branch (match-end 0))\n+                               branch)\n+                           \"none (detached HEAD)\")\n                          head\n                          (if merge-heads\n                              (concat \"\\nMerging:    \"\n-- \n1.5.3.rc6.12.g7c176\n\n-- \nAlexandre Julliard\njulliard@winehq.org\n"}]}