Skip to content

Commit

Permalink
git: refactor jj git clone|fetch to use new GitFetch api directly.
Browse files Browse the repository at this point in the history
* Make the new `GitFetch` api public.
* Move `git::fetch` to `lib/tests/test_git.rs` as `git_fetch`, to minimize
  churn in the tests. Update test call sites to use `git_fetch`
* Delete the `git::fetch` from `lib/src/git.rs`.
* Update `jj git clone` and `git_fetch` in `cli/src/git_utils.rs` to use
  the new api directly. Removing one redundant layer of indirection.
* This fixes #4920 as it first fetches from all remotes before `import_refs()`
  is called, so there is no race condition if the same commit is treated
  differently in different remotes specified in the same command.
* Add test for the race condition.

Fixes: #4920
  • Loading branch information
essiene committed Dec 8, 2024
1 parent 0794f87 commit d96eb38
Show file tree
Hide file tree
Showing 6 changed files with 1,811 additions and 1,771 deletions.
Loading

0 comments on commit d96eb38

Please sign in to comment.