Added a way for supplementary groups to be specified in the rsyncd.conf
[rsync/rsync.git] / support / git-set-file-times
index 9ddef25..077ac0e 100755 (executable)
@@ -1,5 +1,6 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
 use strict;
+use warnings;
 
 # 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 $prefix = @ARGV && $ARGV[0] =~ s/^--prefix=// ? shift : '';
 
 $/ = "\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;
+       map { s/^/$prefix/ } @files;
        utime $commit_time, $commit_time, @files;
     }
     last unless %ls;