Re: [PATCH] Add merge detection to git-cvsimport
- From
- Sven Verdoolaege <skimo@kotnet.org>
- Date
- Aug 16, 2005, 11:07 UTC
- Message-ID
- <20050816110725.GL11882MdfPADPa@garage.linux.student.kuleuven.ac.be>
- In-Reply-To
- <20050816103527.F420A33010C@ng.eduforge.org>
On Tue, Aug 16, 2005 at 10:35:27PM +1200, Martin Langhoff wrote:
> +
> +sub get_headref($$) {If you want to check whether a ref is valid, then it is better to use git-rev-parse...
Show 9 quoted lines
> + my $name = shift;
> + my $git_dir = shift;
> + my $sha;
> +
> + if (open(C,"$git_dir/refs/heads/$name")) {
> + chomp($sha = <C>);
> + close(C);
> + length($sha) == 40
> + or die "Cannot get head id for $name ($sha): $!\n";... but if you're just going to die, then why not simply let git-commit-tree do the test ?
> + if ($mparent eq 'HEAD') { $mparent = 'origin'};Please don't hardcode 'origin' here.
skimo