ok/jj
1
0
Fork 0
forked from mirrors/jj

git_backend: ensure that no-gc ref target never conflicts

This commit is contained in:
Yuya Nishihara 2024-01-13 13:19:24 +09:00
parent f66c859fe4
commit 48c4985e34

View file

@ -594,7 +594,7 @@ fn prevent_gc(git_repo: &gix::Repository, id: &CommitId) -> Result<(), BackendEr
fn to_no_gc_ref_update(id: &CommitId) -> gix::refs::transaction::RefEdit {
let name = format!("{NO_GC_REF_NAMESPACE}{}", id.hex());
let new = gix::refs::Target::Peeled(validate_git_object_id(id).unwrap());
let expected = gix::refs::transaction::PreviousValue::Any;
let expected = gix::refs::transaction::PreviousValue::ExistingMustMatch(new.clone());
gix::refs::transaction::RefEdit {
change: gix::refs::transaction::Change::Update {
log: gix::refs::transaction::LogChange {