diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2019-12-28 19:24:28 +0000 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2019-12-28 19:26:14 +0000 |
commit | 9e13729aa6cec86d8b239c81a50c083ad6a9ba80 (patch) | |
tree | 299bdae0f298251a674561288e5de90f705437c2 /lib | |
parent | b5cc8add0bc645eb3c3410af645ee70d8dee2f17 (diff) | |
download | dotfiles-9e13729aa6cec86d8b239c81a50c083ad6a9ba80.tar.gz |
avoid repeatedly checking whether a file is present within this run
That would break going backwards in the list.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/perl5/Local/MrRepo/Repo/Git/Annex.pm | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/perl5/Local/MrRepo/Repo/Git/Annex.pm b/lib/perl5/Local/MrRepo/Repo/Git/Annex.pm index 0d7989eb..e17de666 100644 --- a/lib/perl5/Local/MrRepo/Repo/Git/Annex.pm +++ b/lib/perl5/Local/MrRepo/Repo/Git/Annex.pm @@ -108,13 +108,16 @@ sub review_unused { my $contentlocation = $self->abs_contentlocation($unused_file->{key}); if (defined $opts{from}) { try { - $self->git->annex("readpresentkey", $unused_file->{key}, $uuid); + $self->git->annex("readpresentkey", $unused_file->{key}, + $uuid); } catch { - $i++, next UNUSED; + splice @unused_files, $i, 1; + next UNUSED; }; - } else { - $i++, next UNUSED unless defined $contentlocation; + } elsif (!defined $contentlocation) { + splice @unused_files, $i, 1; + next UNUSED; } system('clear', '-x') if $opts{interactive}; |