summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2019-12-21 18:10:37 -0700
committerSean Whitton <spwhitton@spwhitton.name>2019-12-21 18:10:37 -0700
commitf82d9fa56d00032e361214a4fb4bf5ce4c9d41da (patch)
tree1db80658c15b7540a37ea7aa7557a57f11c538bd
parentc3360b95ce81a6d2cb087f1f92e368e92d0e5c2b (diff)
downloaddotfiles-f82d9fa56d00032e361214a4fb4bf5ce4c9d41da.tar.gz
use abs2rel rather than a regexp
-rwxr-xr-xbin/annex-to-annex4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/annex-to-annex b/bin/annex-to-annex
index dbff68ff..87266fe6 100755
--- a/bin/annex-to-annex
+++ b/bin/annex-to-annex
@@ -25,7 +25,7 @@ use Digest::MD5::File qw(file_md5);
use File::Basename qw(dirname basename);
use File::Copy;
use File::Find;
-use File::Spec::Functions qw(catfile rel2abs);
+use File::Spec::Functions qw(catfile rel2abs abs2rel);
use IPC::Open2;
# only support v7 because supporting v5 too would make things quite
@@ -90,7 +90,7 @@ foreach my $source (@sources) {
find({
wanted => sub {
- my $rel = $File::Find::name =~ s|^$dir/||r;
+ my $rel = abs2rel($File::Find::name, $dir);
my $target = catfile($dest, $rel);
die "$target already exists!\n" if -e $target and !-d $target;