Alexandre Julliard : git-to-cvs: Use git-for-each-ref to list tags in order to support packed refs.
Module: tools Branch: master Commit: e045280709c2c8f4ff5cd501721d4d59a4a5cb94 URL: http://source.winehq.org/git/tools.git/?a=commit;h=e045280709c2c8f4ff5cd5017... Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jun 14 16:20:42 2007 +0200 git-to-cvs: Use git-for-each-ref to list tags in order to support packed refs. --- git-to-cvs | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/git-to-cvs b/git-to-cvs index bf587fc..8d8ab43 100755 --- a/git-to-cvs +++ b/git-to-cvs @@ -373,14 +373,16 @@ sub apply_commits() # build a list of all commits that are pointed to by a tag sub read_tags() { - opendir DIR, "$git_dir/refs/tags"; - foreach my $tag (grep /^wine/, readdir DIR ) + open LIST, "-|" or exec "git-for-each-ref", "refs/tags/wine*" or die "cannot run git-for-each-ref"; + while (<LIST>) { + next unless /^[0-9a-f]{40} tag\trefs\/tags\/(.*)$/; + my $tag = $1; my $commit = `git-rev-parse $tag^{commit}`; chomp $commit; $tags{$commit} = $tag; } - close DIR; + close LIST; } # use a tmp index file to avoid touching the main one
participants (1)
-
Alexandre Julliard