aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorRichard Mahn <richmahn@users.noreply.github.com>2019-06-29 11:19:24 -0400
committerzeripath <art27@cantab.net>2019-06-29 16:19:24 +0100
commit002b597c1f87cd5c69d32053a62f57c08d48d3ee (patch)
treec14ccd9f1a1b02e21759a4fcae569d8c8116df4f /modules
parent462284e2f5768cf04d71c7abd8c01eef20cff73d (diff)
downloadgitea-002b597c1f87cd5c69d32053a62f57c08d48d3ee.tar.gz
gitea-002b597c1f87cd5c69d32053a62f57c08d48d3ee.zip
Fixes #7152 - Allow create/update/delete message to be empty, use default message (#7324)
* Fixes #7152 - Allow create/update/delete message to be empty, use default message * Linting fix * Fix to delete integration tests
Diffstat (limited to 'modules')
-rw-r--r--modules/repofiles/delete.go5
-rw-r--r--modules/structs/repo_file.go2
2 files changed, 6 insertions, 1 deletions
diff --git a/modules/repofiles/delete.go b/modules/repofiles/delete.go
index 91910fa860..3d9b06b1c1 100644
--- a/modules/repofiles/delete.go
+++ b/modules/repofiles/delete.go
@@ -198,6 +198,11 @@ func DeleteRepoFile(repo *models.Repository, doer *models.User, opts *DeleteRepo
return nil, fmt.Errorf("PushUpdate: %v", err)
}
+ commit, err = t.GetCommit(commitHash)
+ if err != nil {
+ return nil, err
+ }
+
file, err := GetFileResponseFromCommit(repo, commit, opts.NewBranch, treePath)
if err != nil {
return nil, err
diff --git a/modules/structs/repo_file.go b/modules/structs/repo_file.go
index c447d26724..e5be9ce108 100644
--- a/modules/structs/repo_file.go
+++ b/modules/structs/repo_file.go
@@ -8,7 +8,7 @@ package structs
// FileOptions options for all file APIs
type FileOptions struct {
// message (optional) for the commit of this file. if not supplied, a default message will be used
- Message string `json:"message" binding:"Required"`
+ Message string `json:"message"`
// branch (optional) to base this file from. if not given, the default branch is used
BranchName string `json:"branch"`
// new_branch (optional) will make a new branch from `branch` before creating the file