* Make modules/context.Context a context.Context
Signed-off-by: Andrew Thornton <[email protected]>
* Simplify context calls
Signed-off-by: Andrew Thornton <[email protected]>
* Set the base context for requests to the HammerContext
Signed-off-by: Andrew Thornton <[email protected]>
* pass context into get-last-commit
Signed-off-by: Andrew Thornton <[email protected]>
* Make commit_info cancellable
Signed-off-by: Andrew Thornton <[email protected]>
* use context as context
Signed-off-by: Andrew Thornton <[email protected]>
Co-authored-by: 6543 <[email protected]>
* Move last commit cache back into modules/git
Signed-off-by: Andrew Thornton <[email protected]>
* Remove go-git from the interface for last commit cache
Signed-off-by: Andrew Thornton <[email protected]>
* move cacheref to last_commit_cache
Signed-off-by: Andrew Thornton <[email protected]>
* Remove go-git from routers/private/hook
Signed-off-by: Andrew Thornton <[email protected]>
* Move FindLFSFiles to pipeline
Signed-off-by: Andrew Thornton <[email protected]>
* Make no-go-git variants
Signed-off-by: Andrew Thornton <[email protected]>
* Submodule RefID
Signed-off-by: Andrew Thornton <[email protected]>
* fix issue with GetCommitsInfo
Signed-off-by: Andrew Thornton <[email protected]>
* fix GetLastCommitForPaths
Signed-off-by: Andrew Thornton <[email protected]>
* Improve efficiency
Signed-off-by: Andrew Thornton <[email protected]>
* More efficiency
Signed-off-by: Andrew Thornton <[email protected]>
* even faster
Signed-off-by: Andrew Thornton <[email protected]>
* Reduce duplication
* As per @lunny
Signed-off-by: Andrew Thornton <[email protected]>
* attempt to fix drone
Signed-off-by: Andrew Thornton <[email protected]>
* fix test-tags
Signed-off-by: Andrew Thornton <[email protected]>
* default to use no-go-git variants and add gogit build tag
Signed-off-by: Andrew Thornton <[email protected]>
* placate lint
Signed-off-by: Andrew Thornton <[email protected]>
* as per @6543
Signed-off-by: Andrew Thornton <[email protected]>
Co-authored-by: 6543 <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
Replace all calls to os.Remove/os.RemoveAll by retrying util.Remove/util.RemoveAll and remove circular dependencies from util.
Fix#12339
Signed-off-by: Andrew Thornton <[email protected]>
Co-authored-by: silverwind <[email protected]>
In investigating #7947 it has become clear that the storage component of go-git repositories needs closing.
This PR adds this Close function and adds the Close functions as necessary.
In TransferOwnership the ctx.Repo.GitRepo is closed if it is open to help prevent the risk of multiple open files.
Fixes#7947
* Use go-git for tree reading and commit info lookup.
Signed-off-by: Filip Navara <[email protected]>
* Use TreeEntry.IsRegular() instead of ObjectType that was removed.
Signed-off-by: Filip Navara <[email protected]>
* Use the treePath to optimize commit info search.
Signed-off-by: Filip Navara <[email protected]>
* Extract the latest commit at treePath along with the other commits.
Signed-off-by: Filip Navara <[email protected]>
* Fix listing commit info for a directory that was created in one commit and never modified after.
Signed-off-by: Filip Navara <[email protected]>
* Avoid nearly all external 'git' invocations when doing directory listing (.editorconfig code path is still hit).
Signed-off-by: Filip Navara <[email protected]>
* Use go-git for reading blobs.
Signed-off-by: Filip Navara <[email protected]>
* Make SHA1 type alias for plumbing.Hash in go-git.
Signed-off-by: Filip Navara <[email protected]>
* Make Signature type alias for object.Signature in go-git.
Signed-off-by: Filip Navara <[email protected]>
* Fix GetCommitsInfo for repository with only one commit.
Signed-off-by: Filip Navara <[email protected]>
* Fix PGP signature verification.
Signed-off-by: Filip Navara <[email protected]>
* Fix issues with walking commit graph across merges.
Signed-off-by: Filip Navara <[email protected]>
* Fix typo in condition.
Signed-off-by: Filip Navara <[email protected]>
* Speed up loading branch list by keeping the repository reference (and thus all the loaded packfile indexes).
Signed-off-by: Filip Navara <[email protected]>
* Fix lising submodules.
Signed-off-by: Filip Navara <[email protected]>
* Fix build
Signed-off-by: Filip Navara <[email protected]>
* Add back commit cache because of name-rev
Signed-off-by: Filip Navara <[email protected]>
* Fix tests
Signed-off-by: Filip Navara <[email protected]>
* Fix code style
* Fix spelling
* Address PR feedback
Signed-off-by: Filip Navara <[email protected]>
* Update vendor module list
Signed-off-by: Filip Navara <[email protected]>
* Fix getting trees by commit id
Signed-off-by: Filip Navara <[email protected]>
* Fix remaining unit test failures
* Fix GetTreeBySHA
* Avoid running `git name-rev` if not necessary
Signed-off-by: Filip Navara <[email protected]>
* Move Branch code to git module
* Clean up GPG signature verification and fix it for tagged commits
* Address PR feedback (import formatting, copyright headers)
* Make blob lookup by SHA working
* Update tests to use public API
* Allow getting content from any type of object through the blob interface
* Change test to actually expect the object content that is in the GIT repository
* Change one more test to actually expect the object content that is in the GIT repository
* Add comments