forked from mirrors/jj
ef4cb663ae
This patch moves the function for updating branches after rewrite from `commands.rs` into `rewrite.rs`. It also changes the function to update branches even if they were conflicted or become conflicted. I think that seems better than leaving branches on old commits. For example, let's say you have start with this: ``` C main | B origin@main | A ``` You now pull from origin, which has updated the main branch from B to B'. We apply that change to both the remote branch and the local branch, which results in a conflict in the local branch: ``` C main? | B B' main? origin@main |/ A ``` If you now rewrite C to C', the conflicted main branch will still point to C, which is just weird. This patch changes that so the conflicted side of main gets repointed to C'. I also refactored the code to reuse our existing `MutableRepo::merge_single_ref()`, which improves the behavior in several cases, such as the conflict-resolution case in the last test case. |
||
---|---|---|
.. | ||
benches | ||
protos | ||
src | ||
tests | ||
build.rs | ||
Cargo.toml |