mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-19 15:40:50 +00:00
Web editor: improve code quality
This commit is contained in:
parent
67fb0fe6a5
commit
f8a48ffaad
19 changed files with 75 additions and 81 deletions
|
@ -2260,7 +2260,7 @@ func (repo *Repository) GetForks() ([]*Repository, error) {
|
|||
//
|
||||
|
||||
// uploadRepoFiles uploads new files to repository.
|
||||
func (repo *Repository) UploadRepoFiles(doer *User, oldBranchName, branchName, treeName, message string, uuids []string) (err error) {
|
||||
func (repo *Repository) UploadRepoFiles(doer *User, oldBranchName, branchName, treePath, message string, uuids []string) (err error) {
|
||||
repoWorkingPool.CheckIn(com.ToStr(repo.ID))
|
||||
defer repoWorkingPool.CheckOut(com.ToStr(repo.ID))
|
||||
|
||||
|
@ -2276,7 +2276,7 @@ func (repo *Repository) UploadRepoFiles(doer *User, oldBranchName, branchName, t
|
|||
repo.CheckoutNewBranch(oldBranchName, branchName)
|
||||
}
|
||||
|
||||
dirPath := path.Join(localPath, treeName)
|
||||
dirPath := path.Join(localPath, treePath)
|
||||
os.MkdirAll(dirPath, os.ModePerm)
|
||||
|
||||
// Copy uploaded files into repository.
|
||||
|
@ -2298,7 +2298,7 @@ func (repo *Repository) UploadRepoFiles(doer *User, oldBranchName, branchName, t
|
|||
}
|
||||
|
||||
if len(message) == 0 {
|
||||
message = "Add files to '" + treeName + "'"
|
||||
message = "Add files to '" + treePath + "'"
|
||||
}
|
||||
|
||||
if err = git.AddChanges(localPath, true); err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue