mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Do not count undo operations in the 'would be reverted..' message (#3598)
This commit is contained in:
parent
d46e5eca58
commit
70632b088e
1 changed files with 10 additions and 1 deletions
11
src/TDB2.cpp
11
src/TDB2.cpp
|
@ -242,7 +242,16 @@ void TDB2::revert() {
|
|||
bool TDB2::confirm_revert(rust::Vec<tc::Operation>& undo_ops) {
|
||||
// TODO Use show_diff rather than this basic listing of operations, though
|
||||
// this might be a worthy undo.style itself.
|
||||
std::cout << "The following " << undo_ops.size() << " operations would be reverted:\n";
|
||||
|
||||
// Count non-undo operations
|
||||
int ops_count = 0;
|
||||
for (auto& op : undo_ops) {
|
||||
if (!op.is_undo_point()) {
|
||||
ops_count++;
|
||||
}
|
||||
}
|
||||
|
||||
std::cout << "The following " << ops_count << " operations would be reverted:\n";
|
||||
for (auto& op : undo_ops) {
|
||||
if (op.is_undo_point()) {
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue