Merge branch 'jn/gitweb-unborn-head'

* jn/gitweb-unborn-head:
  gitweb: Fix "heads" view when there is no current branch
This commit is contained in:
Junio C Hamano 2012-02-21 15:25:53 -08:00
Родитель d30146ac5f fd49e56af6
Коммит 5609586f65
2 изменённых файлов: 11 добавлений и 2 удалений

Просмотреть файл

@ -5633,7 +5633,7 @@ sub git_tags_body {
sub git_heads_body {
# uses global variable $project
my ($headlist, $head, $from, $to, $extra) = @_;
my ($headlist, $head_at, $from, $to, $extra) = @_;
$from = 0 unless defined $from;
$to = $#{$headlist} if (!defined $to || $#{$headlist} < $to);
@ -5642,7 +5642,7 @@ sub git_heads_body {
for (my $i = $from; $i <= $to; $i++) {
my $entry = $headlist->[$i];
my %ref = %$entry;
my $curr = $ref{'id'} eq $head;
my $curr = defined $head_at && $ref{'id'} eq $head_at;
if ($alternate) {
print "<tr class=\"dark\">\n";
} else {

Просмотреть файл

@ -778,4 +778,13 @@ test_expect_success \
'echo "\$projects_list_group_categories = 1;" >>gitweb_config.perl &&
gitweb_run'
# ----------------------------------------------------------------------
# unborn branches
test_expect_success \
'unborn HEAD: "summary" page (with "heads" subview)' \
'git checkout orphan_branch || git checkout --orphan orphan_branch &&
test_when_finished "git checkout master" &&
gitweb_run "p=.git;a=summary"'
test_done