mirror of
https://gerrit.googlesource.com/git-repo
synced 2026-11-14 08:17:16 +00:00
When `repo info` runs, the reported "Current revision" is resolved using the manifest's target branch tracking ref (e.g. refs/remotes/goog/main). Introduce Project.GetHeadRevisionId(), which gets the checked-out HEAD commit in the worktree, and use it in `repo info` with a fallback to the old behavior if the project is not checked out. Bug: 526685287 Change-Id: I72280ce27daa210cada27d722a94e365644f06e0 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/599481 Reviewed-by: Brian Gan <brgan@google.com> Commit-Queue: Gavin Mak <gavinmak@google.com> Tested-by: 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.