mirror of
https://gerrit.googlesource.com/git-repo
synced 2026-07-15 21:27:00 +00:00
3bb4871c44
When running `repo rebase -m` (`--onto-manifest`), the command uses the raw `revisionExpr` from the manifest (e.g. `main`) directly as the `--onto` target. This can fail or behave incorrectly if it should reference the local tracking branch (e.g. `refs/remotes/<remote>/main`). Resolve `project.revisionExpr` to its local tracking branch using `project.GetRemote().ToLocal()`. Fall back to using the raw `revisionExpr` value if the resolution fails (raising a `GitError`). Bug: 532028666 Change-Id: I4c1bca1374a5842688be227f6aa2afffcdad5397 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/604941 Reviewed-by: Brian Gan <brgan@google.com> Tested-by: Gavin Mak <gavinmak@google.com> Commit-Queue: Gavin Mak <gavinmak@google.com>
Repo Tests
There is a mixture of pytest & Python unittest in here. We adopted pytest later on but didn't migrate existing tests (since they still work). New tests should be written using pytest only.
File layout
test_xxx.py: Unittests for thexxxmodule in the main repo codebase. Modules that are in subdirs normalize the/into_. For example, test_error.py is for the error.py module, and test_subcmds_forall.py is for the subcmds/forall.py module.- conftest.py: Custom pytest fixtures for sharing.
- utils_for_test.py: Helpers for sharing in tests.