gitea/models
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
..
fixtures
migrations
access_test.go
access.go
action_list.go
action_test.go
action.go
admin_test.go
admin.go
attachment_test.go
attachment.go
branches_test.go
branches.go
consistency.go
error_oauth2.go
error.go
external_login_user.go
git_diff_test.go
git_diff.go
gpg_key_test.go
gpg_key.go
graph_test.go
graph.go
helper.go
issue_assignees_test.go
issue_assignees.go
issue_comment_list.go
issue_comment_test.go
issue_comment.go
issue_dependency_test.go
issue_dependency.go
issue_indexer.go
issue_label_test.go
issue_label.go
issue_list_test.go
issue_list.go
issue_mail.go
issue_milestone_test.go
issue_milestone.go
issue_reaction_test.go
issue_reaction.go
issue_stopwatch_test.go
issue_stopwatch.go
issue_test.go
issue_tracked_time_test.go
issue_tracked_time.go
issue_user_test.go
issue_user.go
issue_watch_test.go
issue_watch.go
issue.go
lfs_lock.go
lfs.go Refactor editor upload, update and delete to use git plumbing and add LFS support (#5702) 2019-02-12 15:07:31 +02:00
login_source.go
mail.go
main_test.go
models_sqlite.go
models_test.go
models.go
notification_test.go
notification.go
oauth2.go
org_team_test.go
org_team.go
org_test.go
org.go
pull_test.go
pull.go
release_test.go
release.go
repo_activity.go
repo_branch.go Refactor editor upload, update and delete to use git plumbing and add LFS support (#5702) 2019-02-12 15:07:31 +02:00
repo_collaboration_test.go
repo_collaboration.go
repo_indexer.go
repo_issue.go
repo_list_test.go
repo_list.go
repo_mirror.go
repo_permission_test.go
repo_permission.go
repo_redirect_test.go
repo_redirect.go
repo_tag.go
repo_test.go
repo_unit.go
repo_watch_test.go
repo_watch.go
repo.go
review_test.go
review.go
ssh_key_test.go
ssh_key.go
star_test.go
star.go
status_test.go
status.go
test_fixtures.go
token_test.go
token.go
topic_test.go
topic.go
twofactor.go
u2f_test.go
u2f.go
unit_tests.go
unit.go
update_test.go
update.go
upload.go Refactor editor upload, update and delete to use git plumbing and add LFS support (#5702) 2019-02-12 15:07:31 +02:00
user_follow_test.go
user_follow.go
user_heatmap_test.go
user_heatmap.go
user_mail_test.go
user_mail.go
user_openid_test.go
user_openid.go
user_test.go
user.go
webhook_dingtalk.go
webhook_discord.go
webhook_slack.go
webhook_test.go
webhook.go
wiki_test.go
wiki.go