@@ -1188,6 +1188,22 @@ sub find_parent_branch {
return undef;
}
+############################################################
+
+=item do_fetch()
+
+Fetch an Commit and returns a log entry
+
+Input: $path - array of strings (Paths) in a commit
+ $rev - Revision number
+
+Output: $log_entry if successfull
+ null if skipped
+ (die) on fetch error
+
+=cut
+
+############################################################
sub do_fetch {
my ($self, $paths, $rev) = @_;
my $ed;
@@ -1212,6 +1228,11 @@ sub do_fetch {
}
$ed = Git::SVN::Fetcher->new($self);
}
+ my $skip = $ed->is_empty_commit($paths);
+ if ($skip){
+ print "skip commit $rev\n";
+ return;
+ }
unless ($self->ra->gs_do_update($last_rev, $rev, $self, $ed)) {
die "SVN connection failed somewhere...\n";
}
@@ -139,6 +139,36 @@ sub is_path_ignored {
return 0;
}
+############################################################
+
+=item is_empty_commit()
+
+Return 1 if all given $paths are ignored, so that this commit end up in an empty commit
+
+Input: $path - array of strings (Paths) in a commit
+
+Output: { 1 if true, 0 if false }
+
+=cut
+
+############################################################
+sub is_empty_commit {
+ my ( $self, $paths ) = @_;
+ my $path;
+ my $ignored;
+ unless ( defined( $self->{include_regex} ) ) {
+ return 0;
+ }
+
+ foreach $path ( keys %$paths ) {
+ $ignored = $self->is_path_ignored($path);
+ if ( !$ignored ) {
+ return 0;
+ }
+ }
+ return 1;
+}
+
sub set_path_strip {
my ($self, $path) = @_;
$self->{path_strip} = qr/^\Q$path\E(\/|$)/ if length $path;
@@ -475,6 +475,8 @@ sub gs_fetch_loop_common {
my $log_entry = $gs->do_fetch($paths, $r);
if ($log_entry) {
$gs->do_git_commit($log_entry);
+ }else{
+ next;
}
$Git::SVN::INDEX_FILES{$gs->{index}} = 1;
}