mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-01-11 03:11:50 +00:00
Don't overwrite entry if there are no changes.
This commit is contained in:
@@ -66,6 +66,16 @@ func (l *levelDB) Put(key []byte, value []byte) error {
|
||||
l.batch.Put(key, value)
|
||||
return nil
|
||||
}
|
||||
old, err := l.db.Get(key, nil)
|
||||
if err != nil {
|
||||
if err != leveldb.ErrNotFound {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
if bytes.Compare(old, value) == 0 {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
return l.db.Put(key, value, nil)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user