Commit Graph
5 Commits
Author SHA1 Message Date
74bd9691c6 Re-attempt to delete temporary upload if the file is locked by another process (#12447)
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]>
2020-08-11 21:05:34 +01:00
1dd3f19ee3 Use google/uuid to instead satori/go.uuid (#11943)
Co-authored-by: Lauris BH <[email protected]>
2020-06-18 17:18:44 +08:00
1645d4a5d8 Use ID or Where to instead directly use Get when load object from database (#11925)
* Use ID or Where to instead directly use Get when load object from database

* Apply suggestions from code review

Co-authored-by: 6543 <[email protected]>

Co-authored-by: 6543 <[email protected]>
Co-authored-by: zeripath <[email protected]>
2020-06-17 20:50:11 +03:00
Tamal Sahaandtechknowlogick 171b359877 Use gitea forked macaron (#7933)
Signed-off-by: Tamal Saha <[email protected]>
2019-08-23 12:40:29 -04:00
zeripathandLauris BH 296814e887 Refactor editor upload, update and delete to use git plumbing and add LFS support (#5702)
* Use git plumbing for upload: #5621 repo_editor.go: UploadRepoFile

* Use git plumbing for upload: #5621 repo_editor.go: GetDiffPreview

* Use git plumbing for upload: #5621 repo_editor.go: DeleteRepoFile

* Use git plumbing for upload: #5621 repo_editor.go: UploadRepoFiles

* Move branch checkout functions out of repo_editor.go as they are no longer used there

* BUGFIX: The default permissions should be 100644

    This is a change from the previous code but is more in keeping
    with the default behaviour of git.

Signed-off-by: Andrew Thornton <[email protected]>

* Standardise cleanUploadFilename to more closely match git

See verify_path in: https://github.com/git/git/blob/7f4e64169352e03476b0ea64e7e2973669e491a2/read-cache.c#L951

Signed-off-by: Andrew Thornton <[email protected]>

* Redirect on bad paths

Signed-off-by: Andrew Thornton <[email protected]>

* Refactor to move the uploading functions out to a module

Signed-off-by: Andrew Thornton <[email protected]>

* Add LFS support

Signed-off-by: Andrew Thornton <[email protected]>

* Update upload.go attribution header

Upload.go is essentially the remnants of repo_editor.go. The remaining code is essentially unchanged from the Gogs code, hence the Gogs attribution.

* Delete upload files after session committed

* Ensure that GIT_AUTHOR_NAME etc. are valid for git

see #5774

Signed-off-by: Andrew Thornton <[email protected]>

* Add in test cases per @lafriks comment

* Add space between gitea and github imports

Signed-off-by: Andrew Thornton <[email protected]>

* more examples in TestCleanUploadName

Signed-off-by: Andrew Thornton <[email protected]>

* fix formatting

Signed-off-by: Andrew Thornton <[email protected]>

* Set the SSH_ORIGINAL_COMMAND to ensure hooks are run

Signed-off-by: Andrew Thornton <[email protected]>

* Switch off SSH_ORIGINAL_COMMAND

Signed-off-by: Andrew Thornton <[email protected]>
2019-02-12 15:07:31 +02:00