mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-07 03:28:52 +02:00
Allow API to create file on empty repo (#19224)
This PR adds the necessary work to make it possible to create files on empty repos using the API. Fix #10993 Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
1 parent
54961f3ac9
commit
e69b7a92ed
8 files changed
+175
-117
No files matched your search
@@ -164,9 +164,9 @@ func ApplyDiffPatch(ctx context.Context, repo *repo_model.Repository, doer *user
|
||||
// Now commit the tree
|
||||
var commitHash string
|
||||
if opts.Dates != nil {
|
||||
commitHash, err = t.CommitTreeWithDate(author, committer, treeHash, message, opts.Signoff, opts.Dates.Author, opts.Dates.Committer)
|
||||
commitHash, err = t.CommitTreeWithDate("HEAD", author, committer, treeHash, message, opts.Signoff, opts.Dates.Author, opts.Dates.Committer)
|
||||
} else {
|
||||
commitHash, err = t.CommitTree(author, committer, treeHash, message, opts.Signoff)
|
||||
commitHash, err = t.CommitTree("HEAD", author, committer, treeHash, message, opts.Signoff)
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in new issue
Block a user