summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2021-01-15 22:13:00 +0100
committerRoman Smrž <roman.smrz@seznam.cz>2021-01-15 22:13:00 +0100
commit1466751256580d8b0e6eea46a8028dcab9742f6b (patch)
treedca7436625bb6957c707f329fa12086300660dd6
parent381b6505b5afaacc9194168697f6bc93c43d2775 (diff)
Storage: do not try to replace Head without change
-rw-r--r--src/storage.cpp2
1 files changed, 1 insertions, 1 deletions
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<Ref> Storage::updateHead(UUID type, UUID id, const Ref & old, const std::function<Ref(const Ref &)> & 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))