Subject: [PATCH 12/14] gitweb: add HEAD to list of shortlog refs if detached

From: Giuseppe Bilotta <[email-masked]>
Date: Fri, 31 Aug 2007 13:19:12 +0200

Signed-off-by: Giuseppe Bilotta <[email-masked]>
---
 gitweb/gitweb.perl |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index a745434..4f7b7da 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1688,6 +1688,10 @@ sub git_get_last_activity {
 sub git_get_references {
 	my $type = shift || "";
 	my %refs;
+	if (git_is_head_detached()) {
+		my $hash = git_get_head_hash($project);
+		$refs{$hash} = [ 'HEAD' ];
+	}
 	# 5dc01c595e6c6ec9ccda4f6f69c131c0dd945f8c refs/tags/v2.6.11
 	# c39ae07f393806ccf406ef966e9a15afc43cc36a refs/tags/v2.6.11^{}
 	open my $fd, "-|", git_cmd(), "show-ref", "--dereference",
-- 
1.5.2.5