diff options
author | Daniel Friesel <derf@finalrewind.org> | 2011-05-18 02:49:12 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2011-05-18 02:49:12 +0200 |
commit | 8b12cdc391d6cfedf45b780e37263711aa448a87 (patch) | |
tree | 1fcc79355f348b29dccfd9a68c413f6d5fd8319e | |
parent | c2d52326cf091a82635f1332c6133558d92f9463 (diff) |
Fix hashl ignore
-rwxr-xr-x | bin/hashl | 2 | ||||
-rw-r--r-- | lib/App/Hashl.pm | 4 | ||||
-rw-r--r-- | t/29-app-hashl.t | 2 |
3 files changed, 4 insertions, 4 deletions
@@ -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'); |