Module: tools Branch: master Commit: 6bdf6719a223361a6e265dd9b5ce6c2d595d240c URL: http://source.winehq.org/git/?p=tools.git;a=commit;h=6bdf6719a223361a6e265dd...
Author: Alexandre Julliard julliard@winehq.org Date: Thu Sep 28 11:33:43 2006 +0200
git-to-cvs: Better detection of empty directories when generating .cvsignore.
---
git-to-cvs | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/git-to-cvs b/git-to-cvs index ef393ea..e8b058b 100755 --- a/git-to-cvs +++ b/git-to-cvs @@ -22,6 +22,7 @@ # with .git (or GIT_DIR) pointing to the #
use Unicode::String qw(latin1 utf8); +use File::Find;
my %tags = ();
@@ -176,8 +177,10 @@ sub make_cvsignore($) { my $dir = shift; my %patterns = (); - my @files = glob "$dir/*"; - if (@files > 1) # we always have a CVS dir + my $is_dir_empty = 1; + find sub { $is_dir_empty = 0 unless (-d $_ || $_ eq ".cvsignore" || $File::Find::name =~ //CVS//); }, $dir; + + if (!$is_dir_empty) { foreach $file (read_all_gitignores($dir)) {