summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2019-12-28 20:54:50 +0000
committerSean Whitton <spwhitton@spwhitton.name>2019-12-28 20:54:50 +0000
commit25349ad44a2c2ba66c34cbe1035f6bd2252b4a16 (patch)
tree799f0bf2f298488243e0d570eb2f0c1a0c5c1068 /lib
parentcb1d94f769d0a4cd65b8139b70d8f7be4b008e7e (diff)
downloaddotfiles-25349ad44a2c2ba66c34cbe1035f6bd2252b4a16.tar.gz
drop the cache if we have removed all unused files
Diffstat (limited to 'lib')
-rw-r--r--lib/perl5/Local/MrRepo/Repo/Git/Annex.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/perl5/Local/MrRepo/Repo/Git/Annex.pm b/lib/perl5/Local/MrRepo/Repo/Git/Annex.pm
index 5057e736..f72e8783 100644
--- a/lib/perl5/Local/MrRepo/Repo/Git/Annex.pm
+++ b/lib/perl5/Local/MrRepo/Repo/Git/Annex.pm
@@ -196,7 +196,13 @@ sub review_unused {
# unused files left after this run. note in non-interactive mode
# @to_drop will be empty so will always return 1 if we got this
# far in the subroutine
- return @to_drop != @unused_files;
+ if (@to_drop == @unused_files) {
+ delete $self->{_unused_files};
+ unlink $self->_unused_cache_file;
+ return 0;
+ } else {
+ return 1;
+ }
}