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 9
9
"fmt"
10
10
"io/ioutil"
11
11
"path"
12
- "path/filepath"
13
12
"strings"
14
13
15
14
"code.gitea.io/gitea/models"
@@ -502,7 +501,7 @@ func DeleteFilePost(ctx *context.Context, form auth.DeleteRepoFileForm) {
502
501
if form .CommitChoice == frmCommitChoiceNewBranch && ctx .Repo .Repository .UnitEnabled (models .UnitTypePullRequests ) {
503
502
ctx .Redirect (ctx .Repo .RepoLink + "/compare/" + util .PathEscapeSegments (ctx .Repo .BranchName ) + "..." + util .PathEscapeSegments (form .NewBranchName ))
504
503
} else {
505
- treePath := filepath .Dir (ctx .Repo .TreePath )
504
+ treePath := path .Dir (ctx .Repo .TreePath )
506
505
if treePath == "." {
507
506
treePath = "" // the file deleted was in the root, so we return the user to the root directory
508
507
}
@@ -805,10 +804,10 @@ func GetClosestParentWithFiles(treePath string, commit *git.Commit) string {
805
804
// see if the tree has entries
806
805
if tree , err := commit .SubTree (treePath ); err != nil {
807
806
// failed to get tree, going up a dir
808
- return GetClosestParentWithFiles (filepath .Dir (treePath ), commit )
807
+ return GetClosestParentWithFiles (path .Dir (treePath ), commit )
809
808
} else if entries , err := tree .ListEntries (); err != nil || len (entries ) == 0 {
810
809
// no files in this dir, going up a dir
811
- return GetClosestParentWithFiles (filepath .Dir (treePath ), commit )
810
+ return GetClosestParentWithFiles (path .Dir (treePath ), commit )
812
811
}
813
812
return treePath
814
813
}
You can’t perform that action at this time.
0 commit comments