Skip to content

Commit

Permalink
fix(fsi status): use byte comparison for transform equality test
Browse files Browse the repository at this point in the history
  • Loading branch information
b5 committed Nov 15, 2019
1 parent 98e0cfc commit 73c02a5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 6 additions & 1 deletion base/component/kinds.go
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,12 @@ func (tc *TransformComponent) Compare(compare Component) (bool, error) {
if err := compare.LoadAndFill(nil); err != nil {
return false, err
}
return compareComponentData(tc.Value, other.Value)

// TODO (b5) - for now we're only comparing script bytes, which means changes to transform
// configuration won't be detected by things like status, What's more, because stored transforms include
// a starlark syntax and a "qri" key, comparing FSI to stored JSON won't be equal
// Let's clean this up
return bytes.Equal(tc.Value.ScriptBytes, other.Value.ScriptBytes), nil
}

// WriteTo writes the component as a file to the directory
Expand Down
1 change: 0 additions & 1 deletion fsi/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ func (fsi *FSI) Status(ctx context.Context, dir string) (changes []StatusItem, e

stored.DropDerivedValues()
stored.Commit = nil
stored.Transform = nil
stored.Peername = ""

working, err := component.ListDirectoryComponents(dir)
Expand Down

0 comments on commit 73c02a5

Please sign in to comment.