From cbcf3892e0850bfae538b25808397ef1acbc36cf Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Tue, 4 Feb 2020 17:01:21 -0700 Subject: use source2/other for abs_contentlocation test baz is actually meant to be an unlocked file. Signed-off-by: Sean Whitton --- t/11_utils.t | 17 +++++++++-------- t/lib/t/Setup.pm | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/t/11_utils.t b/t/11_utils.t index 1174109..3d3cb55 100755 --- a/t/11_utils.t +++ b/t/11_utils.t @@ -16,8 +16,9 @@ use File::chdir; use File::Basename qw(basename); with_temp_annexes { - my $temp = shift; - my $annex = Git::Annex->new("source1"); + my $temp = shift; + my $annex = Git::Annex->new("source1"); + my $annex2 = Git::Annex->new("source2"); my $unused_info = catfile($temp, qw(source1 .git annex unused_info)); is $annex->_git_path("blah", "foo"), @@ -34,12 +35,12 @@ with_temp_annexes { ok !-f $unused_info, "_clear_unused_cache deletes the cache"; { - local $CWD = catfile qw(source1 foo foo2); - my $contentlocation = realpath rel2abs readlink "baz"; - my $key = basename readlink "baz"; - is $annex->abs_contentlocation($key), $contentlocation, - "it returns an absolute path to the content for foo/foo2/baz"; - is $annex->abs_contentlocation("foo"), undef, + local $CWD = "source2"; + my $contentlocation = realpath rel2abs readlink "other"; + my $key = basename readlink "other"; + is $annex2->abs_contentlocation($key), $contentlocation, + "it returns an absolute path to the content for other"; + is $annex2->abs_contentlocation("foo"), undef, "it returns undef for a nonsense key"; } }; diff --git a/t/lib/t/Setup.pm b/t/lib/t/Setup.pm index 454fa22..94c3d7c 100644 --- a/t/lib/t/Setup.pm +++ b/t/lib/t/Setup.pm @@ -33,7 +33,7 @@ sub with_temp_annexes (&) { mkdir catfile qw(source1 foo foo2); write_file catfile(qw(source1 foo foo2 baz)), "baz\n"; $source1->RUN(qw(-c annex.gitaddtoannex=false add foo/bar)); - $source1->RUN(qw(-c annex.gitaddtoannex=false annex add foo/foo2/baz)); + $source1->RUN(qw(-c annex.addunlocked=true annex add foo/foo2/baz)); $source1->commit({ message => "add" }); # source2 setup -- cgit v1.2.3