diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2020-02-05 22:09:57 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2020-02-05 22:20:15 -0700 |
commit | 5da99adc1049439dc391736f3e5b1d637e945623 (patch) | |
tree | bf1c2803155511987dba2aeed43bbd59fc89e742 | |
parent | a57cafe128f6117905ed974a4e8c3238120994a6 (diff) | |
download | p5-Git-Annex-5da99adc1049439dc391736f3e5b1d637e945623.tar.gz |
test annex-to-annex-reinject
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rwxr-xr-x | t/23_annex-to-annex-reinject.t | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/t/23_annex-to-annex-reinject.t b/t/23_annex-to-annex-reinject.t new file mode 100755 index 0000000..2e672ea --- /dev/null +++ b/t/23_annex-to-annex-reinject.t @@ -0,0 +1,42 @@ +#!/usr/bin/perl + +use 5.028; +use strict; +use warnings; +use lib 't/lib'; + +use Test::More; +use File::Spec::Functions qw(rel2abs); +use t::Setup; +use File::chdir; + +# make sure that `make test` will always use the right version of the +# script we seek to test +my $a2a = "annex-to-annex"; +my $a2a_ri = "annex-to-annex-reinject"; +$a2a = rel2abs "blib/script/annex-to-annex" if -x "blib/script/annex-to-annex"; +$a2a_ri = rel2abs "blib/script/annex-to-annex-reinject" + if -x "blib/script/annex-to-annex-reinject"; + +with_temp_annexes { + my (undef, undef, $source2) = @_; + + system $a2a, qw(--commit source1/foo source2/other dest); + { + local $CWD = "source2"; + $source2->checkout("master~1"); + ok $source2->annex(qw(find --in=here other)) == 1, + "other is initially present"; + $source2->checkout("master"); + } + system $a2a_ri, qw(source2 dest); + { + local $CWD = "source2"; + $source2->checkout("master~1"); + ok $source2->annex(qw(find --in=here other)) == 0, + "other is reinjected"; + $source2->checkout("master"); + } +}; + +done_testing; |