mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-23 13:55:53 +02:00
Fix bugs
This commit is contained in:
parent
91f972ce82
commit
96e050ec63
@ -425,10 +425,15 @@ func GetTreeInformation(ctx context.Context, repo *repo_model.Repository, treePa
|
|||||||
}
|
}
|
||||||
dir = treePath
|
dir = treePath
|
||||||
if lastDirEntry.IsRegular() {
|
if lastDirEntry.IsRegular() {
|
||||||
dir = path.Dir(treePath)
|
// path.Dir cannot correctly handle .xxx file
|
||||||
lastDirEntry, err = commit.GetTreeEntryByPath(dir)
|
dir, _ = path.Split(treePath)
|
||||||
if err != nil {
|
if dir == "" {
|
||||||
return nil, err
|
lastDirEntry = rootEntry
|
||||||
|
} else {
|
||||||
|
lastDirEntry, err = commit.GetTreeEntryByPath(dir)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -448,6 +453,7 @@ func GetTreeInformation(ctx context.Context, repo *repo_model.Repository, treePa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sortTreeEntries(treeList)
|
||||||
if dir == "" || parentEntry == nil {
|
if dir == "" || parentEntry == nil {
|
||||||
return treeList, nil
|
return treeList, nil
|
||||||
}
|
}
|
||||||
@ -475,7 +481,6 @@ func GetTreeInformation(ctx context.Context, repo *repo_model.Repository, treePa
|
|||||||
Path: path.Join(dir, entry.Name()),
|
Path: path.Join(dir, entry.Name()),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
sortTreeEntries(treeList)
|
|
||||||
sortTreeEntries(parentEntry.Children)
|
sortTreeEntries(parentEntry.Children)
|
||||||
return treeList, nil
|
return treeList, nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user