Skip to content

Commit

Permalink
Issue #150: VFS dirs showing incorrect files
Browse files Browse the repository at this point in the history
I messed up the boolean logic for detecting values.
  • Loading branch information
oniony committed Oct 13, 2018
1 parent 108e919 commit d08ccad
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ Sqlite3 libraries, their Go bindings and the Go language standard library.
Release Notes
=============

v0.7.3
------

* VFS directories were showing incorrect files and tags

v0.7.2
------

Expand Down
2 changes: 1 addition & 1 deletion src/github.com/oniony/TMSU/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ import (
"github.com/oniony/TMSU/common"
)

var Version = common.ParseVersion("0.7.2")
var Version = common.ParseVersion("0.7.3")
6 changes: 3 additions & 3 deletions src/github.com/oniony/TMSU/vfs/fusevfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -844,14 +844,14 @@ func (vfs FuseVfs) openTaggedEntryDir(tx *storage.Tx, path []string) ([]fuse.Dir
var valueNames []string
if lastPathElement[0] != '=' {
expression := pathToExpression(path[:len(path)-1])
files, err := vfs.store.FilesForQuery(tx, expression, "", false, false, "name")
files2, err := vfs.store.FilesForQuery(tx, expression, "", false, false, "name")
if err != nil {
log.Fatalf("could not query files: %v", err)
}

tagName := unescape(lastPathElement)

valueNames, err = vfs.tagValueNamesForFiles(tx, tagName, files)
valueNames, err = vfs.tagValueNamesForFiles(tx, tagName, files2)
if err != nil {
log.Fatalf("could not retrieve values for '%v': %v", tagName, err)
}
Expand Down Expand Up @@ -1108,7 +1108,7 @@ func pathToExpression(path []string) query.Expression {

elementExpression = query.ComparisonExpression{query.TagExpression{tagName}, "==", query.ValueExpression{valueName}}
} else {
if index+1 >= len(path) || path[index+1][0] == '=' {
if index+1 < len(path) && path[index+1][0] == '=' {
continue
}

Expand Down

0 comments on commit d08ccad

Please sign in to comment.