File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 99 "fmt"
1010 "io/ioutil"
1111 "path"
12- "path/filepath"
1312 "strings"
1413
1514 "code.gitea.io/gitea/models"
@@ -502,7 +501,7 @@ func DeleteFilePost(ctx *context.Context, form auth.DeleteRepoFileForm) {
502501 if form .CommitChoice == frmCommitChoiceNewBranch && ctx .Repo .Repository .UnitEnabled (models .UnitTypePullRequests ) {
503502 ctx .Redirect (ctx .Repo .RepoLink + "/compare/" + util .PathEscapeSegments (ctx .Repo .BranchName ) + "..." + util .PathEscapeSegments (form .NewBranchName ))
504503 } else {
505- treePath := filepath .Dir (ctx .Repo .TreePath )
504+ treePath := path .Dir (ctx .Repo .TreePath )
506505 if treePath == "." {
507506 treePath = "" // the file deleted was in the root, so we return the user to the root directory
508507 }
@@ -805,10 +804,10 @@ func GetClosestParentWithFiles(treePath string, commit *git.Commit) string {
805804 // see if the tree has entries
806805 if tree , err := commit .SubTree (treePath ); err != nil {
807806 // failed to get tree, going up a dir
808- return GetClosestParentWithFiles (filepath .Dir (treePath ), commit )
807+ return GetClosestParentWithFiles (path .Dir (treePath ), commit )
809808 } else if entries , err := tree .ListEntries (); err != nil || len (entries ) == 0 {
810809 // no files in this dir, going up a dir
811- return GetClosestParentWithFiles (filepath .Dir (treePath ), commit )
810+ return GetClosestParentWithFiles (path .Dir (treePath ), commit )
812811 }
813812 return treePath
814813}
You can’t perform that action at this time.
0 commit comments