aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/vcs/git_test_util.go
Commit message (Collapse)AuthorAgeFilesLines
* pkg/vcs: extend git testing helpersAleksandr Nogikh2026-01-091-0/+25
| | | | | Add a commitChangeset() method to simplify setting up repository states in tests.
* all: delete dead codeTaras Madan2025-02-101-19/+0
| | | | | go install golang.org/x/tools/cmd/deadcode@latest deadcode -test ./...
* pkg/vcs: export GitWrapperAleksandr Nogikh2025-01-091-3/+3
| | | | | | | | | | | | | The current common vcs interface and its implementations are designed to support a very big number of situations (git modules, cleaning up complex state, etc), which is too heavy and restrictive when we just need a thin wrapper over the git command that supports a few basic operations. Refactor pkg/vcs to split out the wrapper code from the big git implementation of the vcs.Repo interface. Export the wrapper to enable reuse in other parts of the system.
* pkg/vcs: change HeadCommit to CommitDmitry Vyukov2024-10-151-2/+2
| | | | | | | Currently we have HeadCommit function that returns info about the HEAD commit. Change it to a more flexible Commit function that can return info about any commit. This will be used in future changes.
* pkg/vcs: add two more vcs.Repo methodsAleksandr Nogikh2023-04-061-0/+1
| | | | | | | 1) ListCommitHashes, which lists all commit hashes reachable from the specified commit. 2) Object, which allows to query the contents of an object at the specified revision.
* tools/syz-kconf: detect -rcN tagsDmitry Vyukov2020-10-291-1/+1
| | | | | | We currently detect v5.10-rc1 as v5.9 because we ignore -rc tags. This makes it impossible to enable configs that were already added for v5.10. Treat v5.10-rc1 as v5.10 already.
* pkg/vcs: add repo OptPrecious and OptDontSandbox optionsDmitry Vyukov2020-10-211-2/+2
| | | | | | | | | | The pkg/vcs code assumed that we fully manage the repo within an autonomous program. In particular it tried to repair any errors by dropping and re-creating the repo. This does not work well for command-line tools that work with a user-provided repo. Add OptPrecious for such uses. Update #2171
* pkg/vcs: add ReleaseTagDmitry Vyukov2020-10-211-1/+1
| | | | | | | Add ReleaseTag method that returns last release tag for the given commit. Update #2171
* all: fix dup types in func argsDmitry Vyukov2020-07-041-1/+1
|
* tools: add script that checks copyright headersDmitry Vyukov2020-02-181-0/+3
| | | | Fixes #1604
* pkg/vcs: Unset various git environment variables when invoking gitAndrew Donnellan2019-12-121-1/+5
| | | | | | | | | | | | | | | | If you try to run git-using tests while the GIT_DIR environment variable (and GIT_WORK_TREE, etc) happens to be set, the tests are going to do fun and exciting things on a repository that isn't the test repository it tries to set up. As it turns out, if you try to run "make test" using git rebase -x, you'll end up with GIT_DIR set to the syzkaller tree. Hilarity ensues. Unset GIT_DIR, GIT_WORK_TREE and a few other environment variables when invoking git - that way it'll default to looking at the working directory that we have given it, which is what we expect. Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com>
* pkg/bisect: add test for #1527Dmitry Vyukov2019-12-101-0/+123
Update #1527