From 7ad67109d732bd560c8da0356aa555be467d786c Mon Sep 17 00:00:00 2001 From: zeripath Date: Mon, 5 Aug 2019 21:39:39 +0100 Subject: Be more strict with git arguments (#7715) * Be more strict with git arguments * fix-up commit test * use bindings for branch name --- modules/structs/repo_file.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/structs') 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"` -- cgit v1.2.3