summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 470b96d)
raw | patch | inline | side by side (parent: 470b96d)
author | Jakub Narebski <jnareb@gmail.com> | |
Thu, 24 Aug 2006 17:39:32 +0000 (19:39 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sat, 26 Aug 2006 02:39:55 +0000 (19:39 -0700) |
Return on first ref found when git_get_preceding_references
is called in scalar context
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
is called in scalar context
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
gitweb/gitweb.perl | patch | blob | history |
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index b964302a5aa9a24cedc39bb3ffcabb9bc91b6f50..01452d2c747bb29540d512ece6887c91b2ef040e 100755 (executable)
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
or return undef;
my @reflist;
- my $firstref;
foreach my $commit (@commits) {
foreach my $ref (@{$refs->{$commit}}) {
- $firstref = $ref unless $firstref;
+ return $ref unless wantarray;
push @reflist, $ref;
}
}
- return wantarray ? @reflist : $firstref;
+ return @reflist;
}
## ----------------------------------------------------------------------