Merge branch 'th/difftool-diffall'
Finishing touches to difftool --dirdiff. * th/difftool-diffall: difftool: only copy back files modified during directory diff
This commit is contained in:
commit
b18c74c92f
@ -15,6 +15,7 @@ use strict;
|
|||||||
use warnings;
|
use warnings;
|
||||||
use File::Basename qw(dirname);
|
use File::Basename qw(dirname);
|
||||||
use File::Copy;
|
use File::Copy;
|
||||||
|
use File::Compare;
|
||||||
use File::Find;
|
use File::Find;
|
||||||
use File::stat;
|
use File::stat;
|
||||||
use File::Path qw(mkpath);
|
use File::Path qw(mkpath);
|
||||||
@ -336,8 +337,10 @@ if (defined($dirdiff)) {
|
|||||||
# files were modified during the diff, then the changes
|
# files were modified during the diff, then the changes
|
||||||
# should be copied back to the working tree
|
# should be copied back to the working tree
|
||||||
for my $file (@working_tree) {
|
for my $file (@working_tree) {
|
||||||
copy("$b/$file", "$workdir/$file") or die $!;
|
if (-e "$b/$file" && compare("$b/$file", "$workdir/$file")) {
|
||||||
chmod(stat("$b/$file")->mode, "$workdir/$file") or die $!;
|
copy("$b/$file", "$workdir/$file") or die $!;
|
||||||
|
chmod(stat("$b/$file")->mode, "$workdir/$file") or die $!;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (defined($prompt)) {
|
if (defined($prompt)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user