Re: [PATCH 2/3] cvsimport: use show-ref to support packed refs

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

 



Hi,

On Wed, 28 Nov 2007, Jeff King wrote:

> diff --git a/git-cvsimport.perl b/git-cvsimport.perl
> index efa6a0c..b852f2f 100755
> --- a/git-cvsimport.perl
> +++ b/git-cvsimport.perl
> @@ -527,18 +527,12 @@ sub is_sha1 {
>  	return $s =~ /^[a-f0-9]{40}$/;
>  }
>  
> -sub get_headref ($$) {
> -    my $name    = shift;
> -    my $git_dir = shift;
> -
> -    my $f = "$git_dir/$remote/$name";
> -    if (open(my $fh, $f)) {
> -	    chomp(my $r = <$fh>);
> -	    is_sha1($r) or die "Cannot get head id for $name ($r): $!";
> -	    return $r;
> -    }
> -    die "unable to open $f: $!" unless $! == POSIX::ENOENT;
> -    return undef;
> +sub get_headref ($) {
> +	my $name = shift;
> +	my $r = `git show-ref -s '$name'`;
> +	return undef unless $? == 0;
> +	chomp $r;
> +	return $r;
>  }

Where has $remote gone?

Ciao,
Dscho
-
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