only roll back if there are changes
Robert 'phaylon' Sedlacek [Tue, 12 Jun 2012 19:52:20 +0000 (19:52 +0000)]
lib/File/Tree/Snapshot.pm

index 43b3bfa..ec356d4 100644 (file)
@@ -85,6 +85,8 @@ sub commit {
 sub reset {
     my ($self) = @_;
     $self->_git_exec('add .');
+    return 1
+        unless $self->_has_changes;
     $self->_git_exec('checkout -f');
     return 1;
 }