Return on first ref found when git_get_preceding_references
is called in scalar context
Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
or return undef;
my @reflist;
or return undef;
my @reflist;
foreach my $commit (@commits) {
foreach my $ref (@{$refs->{$commit}}) {
foreach my $commit (@commits) {
foreach my $ref (@{$refs->{$commit}}) {
- $firstref = $ref unless $firstref;
+ return $ref unless wantarray;
- return wantarray ? @reflist : $firstref;
}
## ----------------------------------------------------------------------
}
## ----------------------------------------------------------------------