You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an expected hash is provided for a commit, merge or transplant operation, the new storage model validates that the hash exists and is reachable from the current branch HEAD:
e = refMapping.commitInChain(branch, head, referenceHash, emptyList());
}
}
However it does not enforce that the expected hash is the current HEAD. IOW, the operation may succeed even if extra, non-conflicting commits were added to the target branch in the meantime.
This is a bit in contradiction with the merge/transplant API docs for the expected hash parameter:
Currently only 2 endpoints enforce that the expected hash is the current HEAD: assignReference and deleteReference. Both throw HTTP 409 (Conflict) if that's not the case. The reported conflict type is Conflict.ConflictType#UNEXPECTED_HASH.
When an expected hash is provided for a commit, merge or transplant operation, the new storage model validates that the hash exists and is reachable from the current branch HEAD:
nessie/versioned/storage/store/src/main/java/org/projectnessie/versioned/storage/versionstore/BaseCommitHelper.java
Lines 136 to 142 in 795ba1d
However it does not enforce that the expected hash is the current HEAD. IOW, the operation may succeed even if extra, non-conflicting commits were added to the target branch in the meantime.
This is a bit in contradiction with the merge/transplant API docs for the expected hash parameter:
nessie/api/model/src/main/java/org/projectnessie/api/v2/doc/ApiDoc.java
Lines 78 to 80 in 46bf31b
The commit docs OTOH are a bit closer to reality:
nessie/api/model/src/main/java/org/projectnessie/api/v2/doc/ApiDoc.java
Lines 58 to 60 in 46bf31b
It would be good to give users the ability to enforce that the expected hash is the current HEAD and/or revisit the docs for this parameter.
The text was updated successfully, but these errors were encountered: