handle property only changes
[metze/old/samba4-sync/samba4-sync.scripts/.git] / SVN2GitEditor.pm
index 84880802b6c99bcd1ea360ab73dfc71ae72248a4..115487e7acd90c403e7cf507e0253d738a95c8de 100644 (file)
@@ -79,6 +79,11 @@ sub close_file {
     return unless $path;
     my $info = $self->{info}{$path};
 
+    if (not exists $info->{new}) {
+       $info->{new} = '';
+       $info->{nodiff} = 1;
+    }
+
     if (exists $info->{new}) {
        no warnings 'uninitialized';
        my $rpath = $self->{report} ? catfile($self->{report}, $path) : $path;
@@ -172,13 +177,18 @@ sub output_diff {
        $mode = "new file mode $nmode\n";
     }
 
+    my $index = "";
+    $index = "index $osha1..$nsha1\n" unless $self->{info}{$path}{nodiff};
+
     print $fh (
        "diff --git $ofile $nfile\n",
        $name,
        $mode,
-       "index $osha1..$nsha1\n"
+       $index
     );
 
+    return if $self->{info}{$path}{nodiff};
+
     unshift @_, $self->_output_fh;
     push @_, $ofile, $nfile;