Commit graph

4 commits

Author SHA1 Message Date
Yuya Nishihara
67d07751a5 tests: add basic test for undoing git import/export in non-colocated repo
If "jj op undo" doesn't roll back git refs (#1541), test_git_import_undo()
would get weird state. I think these tests are easier to follow than
test_git_fetch_undo() since no remote refs are involved.
2023-04-25 14:01:24 +09:00
Glen Choo
3418c8ff73 git: add git.auto-local-branch
Add a new git.auto-local-branch config option. When set to false, a
remote-tracking branch imported from Git will not automatically create a
local branch target. This is implemented by a new GitSettings struct
that passes Git-related settings from UserSettings.

This behavior is particularly useful in a co-located jj and Git repo,
because a Git remote might have branches that are not of everyday
interest to the user, so it does not make sense to export them as local
branches in Git. E.g. https://github.com/gitster/git, the maintainer's
fork of Git, has 379 branches, most of which are topic branches kept
around for historical reasons, and Git developers wouldn't be expected
to have local branches for each remote-tracking branch.
2023-01-29 20:17:49 -08:00
Glen Choo
4716c1e9e2 git: test import of remote-only branch
This test coverage will become more important when we make changes to
remote branch importing.
2023-01-29 20:17:49 -08:00
Glen Choo
469d315003 git: rename test to cover import/export
We'll add an import test in the next commit.
2023-01-29 20:17:49 -08:00
Renamed from tests/test_git_export.rs (Browse further)