From: Robert 'phaylon' Sedlacek Date: Tue, 12 Jun 2012 19:52:20 +0000 (+0000) Subject: only roll back if there are changes X-Git-Tag: v0.000001~8 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=aff04a36b6f3fb287ef6e325b7eb80327774d2a5;p=scpubgit%2FFile-Tree-Snapshot.git only roll back if there are changes --- diff --git a/lib/File/Tree/Snapshot.pm b/lib/File/Tree/Snapshot.pm index 43b3bfa..ec356d4 100644 --- a/lib/File/Tree/Snapshot.pm +++ b/lib/File/Tree/Snapshot.pm @@ -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; }