Git will and can pack references into packfiles and therefore if you write/read the
files directly you will get false results. Instead you should use update-ref and
show-ref. To that end I have created three new functions in git/repo_commit.go that
will do this correctly.
Related #17191
Signed-off-by: Andrew Thornton <[email protected]>
The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil. This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.
Signed-off-by: Eng Zer Jun <[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]>
* Save patches to temporary files
* Remove SavePatch and generate patches on the fly
* Use ioutil.TempDir
* fixup! Use ioutil.TempDir
* fixup! fixup! Use ioutil.TempDir
* RemoveAll LocalCopyPath() in initIntergrationTest
* Default to status checking on PR creation
* Remove unnecessary set to StatusChecking
* Protect against unable to load repo
* Handle conflicts
* Restore original conflict setting
* In TestPullRequests update status to StatusChecking before running TestPatch
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
* Supports tags when comparing commits or branches
Signed-off-by: Mario Lubenka <[email protected]>
* Hide headline when only comparing and don't load unused data
Signed-off-by: Mario Lubenka <[email protected]>
* Merges compare logics to allow comparing branches, commits and tags with eachother
Signed-off-by: Mario Lubenka <[email protected]>
* Display branch or tag instead of commit when used for comparing
Signed-off-by: Mario Lubenka <[email protected]>
* Show pull request form after click on button
Signed-off-by: Mario Lubenka <[email protected]>
* Transfers relevant pull.go changes from master to compare.go
Signed-off-by: Mario Lubenka <[email protected]>
* Fixes error when comparing forks against a commit or tag
Signed-off-by: Mario Lubenka <[email protected]>
* Removes console.log from JavaScript file
Signed-off-by: Mario Lubenka <[email protected]>
* Show icon next to commit reference when comparing branch or tag
Signed-off-by: Mario Lubenka <[email protected]>
* Updates css file
Signed-off-by: Mario Lubenka <[email protected]>
* Fixes import order
* Renames template variable
* Update routers/repo/compare.go
Co-Authored-By: zeripath <[email protected]>
* Update from master
Signed-off-by: Mario Lubenka <[email protected]>
* Allow short-shas in compare
* Renames prInfo to compareInfo
Signed-off-by: Mario Lubenka <[email protected]>
* Check PR permissions only if compare is pull request
Signed-off-by: Mario Lubenka <[email protected]>
* Adjusts comment
Signed-off-by: Mario Lubenka <[email protected]>
* Use compareInfo instead of prInfo