From 1466751256580d8b0e6eea46a8028dcab9742f6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Fri, 15 Jan 2021 22:13:00 +0100 Subject: Storage: do not try to replace Head without change --- src/storage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/storage.cpp b/src/storage.cpp index b5bff8c..45caadb 100644 --- a/src/storage.cpp +++ b/src/storage.cpp @@ -660,7 +660,7 @@ bool Storage::replaceHead(UUID type, UUID id, const Ref & old, const Ref & ref) optional Storage::updateHead(UUID type, UUID id, const Ref & old, const std::function & f) { Ref r = f(old); - if (replaceHead(type, id, old, r)) + if (r.digest() == old.digest() || replaceHead(type, id, old, r)) return r; if (auto cur = old.storage().headRef(type, id)) -- cgit v1.2.3