jj/lib
Martin von Zweigbergk 8a440d8042 git: on export, use repo view's git_refs as record of old export state
@yuja asked on #701 about the difference between the state in the
`git_export_view` and what we have in `mut_repo.view()`. It's true
that the branches in `mut_repo.view().git_refs()` should match what we
wrote to disk. We can therefore remove the on-disk storage and
simplify quite a bit. For now, I create the `last_export_view` from
the `mut_repo.view().git_refs()` before calling
`export_changes()`. I'll clean up a bit more next.

I think this is correct even considering e.g. undo. Let's consider
what would happen in a non-colocated Git repo (not because tricky
cases cannot happen there but because the explicit exports and imports
make it easier to discuss, and more cases can occur). If the user
moved a branch and then did `jj git export`, `jj undo`, and then `jj
git export` again, we would think on the second export that we should
perform the same changes to the Git repo, which should have no effect.

This patch also fixes the bug we were forced to work around in the
test case in the previous patch.

This removes one of our uses of Thrift.
2022-12-03 09:32:49 -08:00
..
src git: on export, use repo view's git_refs as record of old export state 2022-12-03 09:32:49 -08:00
tests git: on export, use repo view's git_refs as record of old export state 2022-12-03 09:32:49 -08:00
testutils copyright: change from "Google LLC" to "The Jujutsu Authors" 2022-11-28 06:05:45 -10:00
build.rs copyright: change from "Google LLC" to "The Jujutsu Authors" 2022-11-28 06:05:45 -10:00
Cargo.toml cargo: bump insta from 1.21.1 to 1.21.2 2022-11-28 05:29:03 -10:00