Skip to content

Commit

Permalink
git: update 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 15, 2024
1 parent dc16830 commit b733e17
Show file tree
Hide file tree
Showing 6 changed files with 1,832 additions and 1,807 deletions.
Loading

0 comments on commit b733e17

Please sign in to comment.