summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2020-01-12 11:58:47 +0000
committerSean Whitton <spwhitton@spwhitton.name>2020-01-12 12:28:08 +0000
commita7209abf52ec7ae41fa2e1f607b7d49ef45fca6a (patch)
treee1629129b8d6ea6589a7755b2af5eb6e337a722e
parentd50018fa95738e59e16606d93e963b15b5240c74 (diff)
downloaddotfiles-a7209abf52ec7ae41fa2e1f607b7d49ef45fca6a.tar.gz
confirm dropunused after review
Since user might not expect they've reached the end of the list of items to review and the drop will go ahead.
-rw-r--r--lib/perl5/Local/MrRepo/Repo/Git/Annex.pm12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/perl5/Local/MrRepo/Repo/Git/Annex.pm b/lib/perl5/Local/MrRepo/Repo/Git/Annex.pm
index 412c3d75..7bf976f5 100644
--- a/lib/perl5/Local/MrRepo/Repo/Git/Annex.pm
+++ b/lib/perl5/Local/MrRepo/Repo/Git/Annex.pm
@@ -1,6 +1,6 @@
package Local::MrRepo::Repo::Git::Annex;
-# Copyright (C) 2019 Sean Whitton
+# Copyright (C) 2019-2020 Sean Whitton
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -29,7 +29,7 @@ use JSON;
use Local::ScriptStatus;
use Try::Tiny;
use Term::ReadKey;
-use Local::Interactive qw(prompt);
+use Local::Interactive qw(prompt prompt_yn);
use Storable;
use List::Util qw(all);
@@ -201,7 +201,13 @@ sub review_unused {
$i++;
}
- $self->git->annex("dropunused", \%dropunused_args, @to_drop) if @to_drop;
+ if (@to_drop) {
+ say_spaced_bullet("Will dropunused"
+ . (exists $dropunused_args{force} ? " with --force:" : ":"));
+ say "@to_drop\n";
+ $self->git->annex("dropunused", \%dropunused_args, @to_drop)
+ if prompt_yn("Go ahead with this?");
+ }
# return boolean value representing whether or not there are any
# 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