gitea/routers/repo
zeripath 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 <art27@cantab.net>

* Standardise cleanUploadFilename to more closely match git

See verify_path in: 7f4e641693/read-cache.c (L951)

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Redirect on bad paths

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Refactor to move the uploading functions out to a module

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Add LFS support

Signed-off-by: Andrew Thornton <art27@cantab.net>

* 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 <art27@cantab.net>

* Add in test cases per @lafriks comment

* Add space between gitea and github imports

Signed-off-by: Andrew Thornton <art27@cantab.net>

* more examples in TestCleanUploadName

Signed-off-by: Andrew Thornton <art27@cantab.net>

* fix formatting

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Set the SSH_ORIGINAL_COMMAND to ensure hooks are run

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Switch off SSH_ORIGINAL_COMMAND

Signed-off-by: Andrew Thornton <art27@cantab.net>
2019-02-12 15:07:31 +02:00
..
activity.go Restrict permission check on repositories and fix some problems (#5314) 2018-11-28 19:26:14 +08:00
attachment.go
branch.go branch: Trigger update when deleting branch via UI. (#5617) 2019-01-02 20:56:58 +08:00
commit.go fix commit page showing status for current default branch (#5650) 2019-01-06 16:32:00 +02:00
download.go Add raw blob endpoint to get objects by SHA ID (#5334) 2018-11-18 13:45:40 -05:00
editor_test.go Refactor editor upload, update and delete to use git plumbing and add LFS support (#5702) 2019-02-12 15:07:31 +02:00
editor.go Refactor editor upload, update and delete to use git plumbing and add LFS support (#5702) 2019-02-12 15:07:31 +02:00
http.go In basic auth check for tokens before call UserSignIn (#5725) 2019-02-12 11:20:08 +02:00
issue_dependency.go
issue_label_test.go
issue_label.go
issue_stopwatch.go Automatically clear stopwatch on merging a PR (#4327) 2019-02-05 13:38:11 +02:00
issue_timetrack.go
issue_watch.go Restrict permission check on repositories and fix some problems (#5314) 2018-11-28 19:26:14 +08:00
issue.go Automatically clear stopwatch on merging a PR (#4327) 2019-02-05 13:38:11 +02:00
main_test.go
middlewares.go
milestone.go Issue is not overdue when it is on the same date #5566 (#5568) 2019-01-01 18:56:47 +01:00
pull_review.go Add comment replies (#5104) 2018-10-22 16:13:35 -04:00
pull.go Add the Owner Name to differentiate when merging (#3807) 2019-02-12 10:37:32 +02:00
release_test.go
release.go Feature: Archive repos (#5009) 2019-01-23 13:58:38 -05:00
repo.go Refactor repo.isBare to repo.isEmpty #5629 (#5714) 2019-01-17 19:01:04 -05:00
search.go
setting_protected_branch.go Approvals at Branch Protection (#5350) 2018-12-11 19:28:37 +08:00
setting.go Add option to close issues via commit on a non master branch (#5992) 2019-02-10 21:27:19 +02:00
settings_test.go
topic.go
view.go Feature: Archive repos (#5009) 2019-01-23 13:58:38 -05:00
webhook.go Slack webhook channel name cannot be empty or just contain an hashtag (#4786) 2018-09-10 10:31:08 -04:00
wiki_test.go Fix serving of raw wiki files other than .md (#5814) 2019-02-05 20:58:55 -05:00
wiki.go Fix serving of raw wiki files other than .md (#5814) 2019-02-05 20:58:55 -05:00