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

git: update comment about remote-tracking branches to be exported

Spotted while porting it to per-remote views. Undone fetch/push is tricky. If
we want to detect git/jj conflicts in that scenario, we would need to track
both "known" and "current" remote targets. It's probably okay to export jj's
remote targets as we do the reverse for import_refs(), but I need to think
that a bit more.
This commit is contained in:
Yuya Nishihara 2023-09-22 20:28:26 +09:00
parent 4894636d10
commit 4974065edb

View file

@ -531,10 +531,9 @@ fn diff_refs_to_export(
let new_target = match &ref_name {
RefName::LocalBranch(branch) => view.get_local_branch(branch),
RefName::RemoteBranch { remote, branch } => {
// Currently, the only situation where this case occurs *and* new_target !=
// old_target is after a `jj branch forget`. So, in practice, for
// remote-tracking branches either `new_target == old_target` or
// `new_target == None`.
// There are two situations where remote-tracking branches get out of sync:
// 1. `jj branch forget`
// 2. `jj op undo`/`restore` in colocated repo
view.get_remote_branch(branch, remote)
}
_ => continue,