Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Handle non-srcdir man copying when yodl isn't installed.
[rsync/rsync.git]
/
support
/
git-set-file-times
diff --git
a/support/git-set-file-times
b/support/git-set-file-times
index
9ddef25
..
077ac0e
100755
(executable)
--- a/
support/git-set-file-times
+++ b/
support/git-set-file-times
@@
-1,5
+1,6
@@
-#!/usr/bin/perl
-w
+#!/usr/bin/perl
use strict;
use strict;
+use warnings;
# Sets mtime and atime of files to the latest commit time in git.
#
# Sets mtime and atime of files to the latest commit time in git.
#
@@
-8,6
+9,7
@@
use strict;
my %ls;
my $commit_time;
my %ls;
my $commit_time;
+my $prefix = @ARGV && $ARGV[0] =~ s/^--prefix=// ? shift : '';
$/ = "\0";
open FH, 'git ls-files -z|' or die $!;
$/ = "\0";
open FH, 'git ls-files -z|' or die $!;
@@
-27,6
+29,7
@@
while (<FH>) {
my @files = delete @ls{split(/\0/, $_)};
@files = grep { defined $_ } @files;
next unless @files;
my @files = delete @ls{split(/\0/, $_)};
@files = grep { defined $_ } @files;
next unless @files;
+ map { s/^/$prefix/ } @files;
utime $commit_time, $commit_time, @files;
}
last unless %ls;
utime $commit_time, $commit_time, @files;
}
last unless %ls;