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
* Allow git.GetTree to take both commit and tree names, return full paths on entries listed through Tree.ListEntriesRecursive
Signed-off-by: Filip Navara <[email protected]>
* Fix the SHA returned on Git Tree APIs called with commit hash or symbolic name
Signed-off-by: Filip Navara <[email protected]>
* 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