summaryrefslogtreecommitdiffstats
path: root/modules/structs/repo_file.go
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2019-08-05 21:39:39 +0100
committerGitHub <noreply@github.com>2019-08-05 21:39:39 +0100
commit7ad67109d732bd560c8da0356aa555be467d786c (patch)
tree7c7a35761b01e2eec6a823f0caf40748c3b7f327 /modules/structs/repo_file.go
parent1d8915ad5d9889c02dd98ab2c2f29aa8f5ee4dfa (diff)
downloadgitea-7ad67109d732bd560c8da0356aa555be467d786c.tar.gz
gitea-7ad67109d732bd560c8da0356aa555be467d786c.zip
Be more strict with git arguments (#7715)
* Be more strict with git arguments * fix-up commit test * use bindings for branch name
Diffstat (limited to 'modules/structs/repo_file.go')
-rw-r--r--modules/structs/repo_file.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/structs/repo_file.go b/modules/structs/repo_file.go
index b2eeb7f13a..cb836e2e23 100644
--- a/modules/structs/repo_file.go
+++ b/modules/structs/repo_file.go
@@ -10,9 +10,9 @@ type FileOptions struct {
// message (optional) for the commit of this file. if not supplied, a default message will be used
Message string `json:"message"`
// branch (optional) to base this file from. if not given, the default branch is used
- BranchName string `json:"branch"`
+ BranchName string `json:"branch" binding:"GitRefName;MaxSize(100)"`
// new_branch (optional) will make a new branch from `branch` before creating the file
- NewBranchName string `json:"new_branch"`
+ NewBranchName string `json:"new_branch" binding:"GitRefName;MaxSize(100)"`
// `author` and `committer` are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used)
Author Identity `json:"author"`
Committer Identity `json:"committer"`