From cb1ecb856ab48bbc29a3ad7f2f41f665dd54d592 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Tue, 10 Mar 2020 13:09:43 -0700 Subject: fix some more paths, passed to --batch commands Signed-off-by: Sean Whitton --- Changes | 6 ++++++ lib/App/annex_to_annex.pm | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Changes b/Changes index 5b10f77..ffb86d5 100644 --- a/Changes +++ b/Changes @@ -3,6 +3,12 @@ Revision history for Git::Annex {{$NEXT}} - annex-to-annex: Fix path passed to git-annex-find(1) when looking for missing files. + - annex-to-annex: Fix path passed to git-annex-lookupkey(1) when + determining whether source files are annexed. + - annex-to-annex: Pass relative path to git-annex-find(1) when + determining if a file was unlocked in the source annex. + Workaround for bug in git-annex: git-annex-find(1) returns + incorrect response for absolute paths when in --batch mode. 0.002 2020-02-24 07:33:02-07:00 America/Phoenix - Fix logic in an example in Git::Annex::BatchCommand SYNOPSIS. diff --git a/lib/App/annex_to_annex.pm b/lib/App/annex_to_annex.pm index cd054cc..af4346b 100644 --- a/lib/App/annex_to_annex.pm +++ b/lib/App/annex_to_annex.pm @@ -130,7 +130,7 @@ sub main { die "$target already exists!\n" if -e $target and !-d $target; - my $key = $lk->ask($rel); + my $key = $lk->ask($File::Find::name); if ($key) { # this is an annexed file my $content = rel2abs $cl->ask($key), $annex->toplevel; my $content_device_id = (stat $content)[0]; @@ -147,7 +147,8 @@ sub main { # to the source, or anything like that system "git", "-C", $dest, "annex", "add", $rel; system "git", "-C", $dest, "annex", "unlock", $rel - if $find->ask($rel); + if $find->ask(abs2rel $File::Find::name, + $annex->toplevel); # if using the default backend, quick sanity check if ($key =~ /^SHA256E-s[0-9]+--([0-9a-f]+)/) { -- cgit v1.2.3