From 8b12cdc391d6cfedf45b780e37263711aa448a87 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 18 May 2011 02:49:12 +0200 Subject: Fix hashl ignore --- bin/hashl | 2 +- lib/App/Hashl.pm | 4 ++-- t/29-app-hashl.t | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/hashl b/bin/hashl index 60c383e..89c0219 100755 --- a/bin/hashl +++ b/bin/hashl @@ -178,7 +178,7 @@ sub db_update { sub db_ignore { my ($file, $path) = @_; - $hashl->ignore($path); + $hashl->ignore($file, $path); } sub db_copy { diff --git a/lib/App/Hashl.pm b/lib/App/Hashl.pm index 8d3187c..9ce17a5 100644 --- a/lib/App/Hashl.pm +++ b/lib/App/Hashl.pm @@ -147,10 +147,10 @@ sub ignored { } sub ignore { - my ($self, $file) = @_; + my ($self, $file, $path) = @_; $self->delete_file($file); - push(@{ $self->{ignored}->{hashes} }, $self->hash_file($file)); + push(@{ $self->{ignored}->{hashes} }, $self->hash_file($path)); } sub save { diff --git a/t/29-app-hashl.t b/t/29-app-hashl.t index fffe9cc..608a3a2 100644 --- a/t/29-app-hashl.t +++ b/t/29-app-hashl.t @@ -49,7 +49,7 @@ is_deeply($hashl->file('t/in/4'), ok($hashl->file_in_db('t/in/4'), 'file is now in db'); ok($hashl->hash_in_db($test_hash), 'hash is in db'); -ok($hashl->ignore('t/in/4'), 'ignore file'); +ok($hashl->ignore('t/in/4', 't/in/4'), 'ignore file'); is($hashl->file_in_db('t/in/4'), $IGNORED, 'file no longer in db'); is_deeply([$hashl->ignored()], [$test_hash], 'file is ignored'); -- cgit v1.2.3