Re: [PATCH] Git.pm: Add remote_refs() git-ls-remote frontend

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Aug 26, 2007 at 06:26:29AM CEST, Junio C Hamano wrote:
> Petr Baudis <pasky@xxxxxxx> writes:
> 
> > diff --git a/git-remote.perl b/git-remote.perl
> > index 01cf480..8ce8418 100755
> > --- a/git-remote.perl
> > +++ b/git-remote.perl
> > @@ -128,10 +128,7 @@ sub update_ls_remote {
> >  	return if (($harder == 0) ||
> >  		   (($harder == 1) && exists $info->{'LS_REMOTE'}));
> >  
> > -	my @ref = map {
> > -		s|^[0-9a-f]{40}\s+refs/heads/||;
> > -		$_;
> > -	} $git->command(qw(ls-remote --heads), $info->{'URL'});
> > +	my @ref = keys %{$git->remote_refs($info->{'URL'}, [ 'heads' ])};
> >  	$info->{'LS_REMOTE'} = \@ref;
> >  }
> 
> IIRC, ls-remote returns refs sorted and this function returns
> them as it receives.
> 
> Doesn't this change make @ref randomly ordered?  

Yes, but I couldn't find any place in git-remote.perl where we rely on
the @ref ordering - maybe I'm blind...

-- 
				Petr "Pasky" Baudis
Ever try. Ever fail. No matter. // Try again. Fail again. Fail better.
		-- Samuel Beckett
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux