working_copy: on finish(), don't serialize checkout if operation_id is unchanged

Maybe it's okay to always save the checkout state, but let's apply the same
rule as the previous commit.
This commit is contained in:
Yuya Nishihara 2022-10-02 12:23:42 +09:00
parent a8a3a236b0
commit dc9a9ed4c1

View File

@ -1207,8 +1207,10 @@ impl LockedWorkingCopy<'_> {
if self.tree_state_dirty { if self.tree_state_dirty {
self.wc.tree_state_mut().save(); self.wc.tree_state_mut().save();
} }
self.wc.operation_id.replace(Some(operation_id)); if self.old_operation_id != operation_id {
self.wc.save(); self.wc.operation_id.replace(Some(operation_id));
self.wc.save();
}
// TODO: Clear the "pending_checkout" file here. // TODO: Clear the "pending_checkout" file here.
self.tree_state_dirty = false; self.tree_state_dirty = false;
self.closed = true; self.closed = true;