No reason to trigger excessive writes when nothing is done.
---
lib/Ssoma/Extractor.pm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/Ssoma/Extractor.pm b/lib/Ssoma/Extractor.pm
index 7e2b5d1..baf9adb 100644
--- a/lib/Ssoma/Extractor.pm
+++ b/lib/Ssoma/Extractor.pm
@@ -47,6 +47,7 @@ sub _extract {
my $lkey = "target.$target.last-imported";
my $last = $cfg->{$lkey};
+ my $last_imported = $last;
my $ref = $self->{ref};
my $tip = $git->qx_sha1("git rev-parse $ref^0");
@@ -106,7 +107,7 @@ sub _extract {
}
# update the last-imported var
- {
+ if (!defined($last_imported) || $last_imported ne $tip) {
# This state file is important, and git does not fsync it.
if (open my $st, '<', $state) {
# clobber existing backup
--
EW