diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2021-01-15 22:13:00 +0100 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2021-01-15 22:13:00 +0100 |
commit | 1466751256580d8b0e6eea46a8028dcab9742f6b (patch) | |
tree | dca7436625bb6957c707f329fa12086300660dd6 /src | |
parent | 381b6505b5afaacc9194168697f6bc93c43d2775 (diff) |
Storage: do not try to replace Head without change
Diffstat (limited to 'src')
-rw-r--r-- | src/storage.cpp | 2 |
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)) |