Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2020-10-14 11:26:51 +0300
committerKamil Trzciński <ayufan@ayufan.eu>2020-10-14 11:26:51 +0300
commit715421d626df612c78264a6377edcca1fbb1e36a (patch)
treee20ddffa32e9286db350bbfeeeb228a5cbcbc195
parent0ef6b5982e26f5957fbe5eaf0332f73625a3d24f (diff)
Apply 2 suggestion(s) to 1 file(s)fix-zip-directories
-rw-r--r--internal/vfs/zip/archive.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/internal/vfs/zip/archive.go b/internal/vfs/zip/archive.go
index 5a49a2a4..ba15af20 100644
--- a/internal/vfs/zip/archive.go
+++ b/internal/vfs/zip/archive.go
@@ -156,7 +156,7 @@ func (a *zipArchive) readArchive() {
// addPathDirectory adds a directory for a given path
func (a *zipArchive) addPathDirectory(path string) {
- // Split makes `path` with `/`
+ // Split dir and file from `path`
path, _ = filepath.Split(path)
if path == "" {
return
@@ -184,11 +184,7 @@ func (a *zipArchive) findFile(name string) *zip.File {
func (a *zipArchive) findDirectory(name string) *zip.FileHeader {
name = filepath.Join(dirPrefix, name)
- if dir := a.directories[name+"/"]; dir != nil {
- return dir
- }
-
- return nil
+ return a.directories[name+"/"]
}
// Open finds the file by name inside the zipArchive and returns a reader that can be served by the VFS