Merge branch 'aw/cvsimport'

* aw/cvsimport:
  cvsimport: move over to using git-for-each-ref to read refs.
This commit is contained in:
Junio C Hamano 2006-10-25 14:10:50 -07:00
commit 01fe679a34

View File

@ -495,22 +495,17 @@ unless(-d $git_dir) {
$tip_at_start = `git-rev-parse --verify HEAD`; $tip_at_start = `git-rev-parse --verify HEAD`;
# Get the last import timestamps # Get the last import timestamps
opendir(D,"$git_dir/refs/heads"); my $fmt = '($ref, $author) = (%(refname), %(author));';
while(defined(my $head = readdir(D))) { open(H, "git-for-each-ref --perl --format='$fmt' refs/heads |") or
next if $head =~ /^\./; die "Cannot run git-for-each-ref: $!\n";
open(F,"$git_dir/refs/heads/$head") while(defined(my $entry = <H>)) {
or die "Bad head branch: $head: $!\n"; my ($ref, $author);
chomp(my $ftag = <F>); eval($entry) || die "cannot eval refs list: $@";
close(F); my ($head) = ($ref =~ m|^refs/heads/(.*)|);
open(F,"git-cat-file commit $ftag |"); $author =~ /^.*\s(\d+)\s[-+]\d{4}$/;
while(<F>) { $branch_date{$head} = $1;
next unless /^author\s.*\s(\d+)\s[-+]\d{4}$/;
$branch_date{$head} = $1;
last;
}
close(F);
} }
closedir(D); close(H);
} }
-d $git_dir -d $git_dir