Skip to content

Commit ccadc98

Browse files
authored
Fix diff cmd (#109)
* Make it so diff command actually reads both provided args. * Take envelopes fix for cache issue.
1 parent c4fb9b7 commit ccadc98

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

cmd/diff.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ func getDiffStates(ctx context.Context, args []string, indexRoot string) (*envel
102102
return target.State, nil
103103
}
104104

105-
index.LoadState(ctx, indexRoot)
106105
switch len(args) {
107106
case 0: // Compare current index against HEAD
108107
right, err = loadFromRepository(ctx, persist.MostRecentTransactionAlias)
@@ -130,7 +129,7 @@ func getDiffStates(ctx context.Context, args []string, indexRoot string) (*envel
130129
return nil, nil, err
131130
}
132131

133-
left, err = loadFromRepository(ctx, persist.RefSpec(args[0]))
132+
left, err = loadFromRepository(ctx, persist.RefSpec(args[1]))
134133
if err != nil {
135134
return nil, nil, err
136135
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module github.com/marstr/baronial
22

33
require (
4-
github.com/marstr/envelopes v0.5.1-0.20250706052704-abd708bd96d8
4+
github.com/marstr/envelopes v0.5.1-0.20250724195254-1badb247f40f
55
github.com/marstr/units v1.0.1
66
github.com/mitchellh/go-homedir v1.1.0
77
github.com/sirupsen/logrus v1.2.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDe
1919
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
2020
github.com/marstr/collection/v2 v2.0.0 h1:a0J20uXTesrD0HaCd+EyvTJzs34KQwEDVw12nd9q9Bw=
2121
github.com/marstr/collection/v2 v2.0.0/go.mod h1:53MC3XxVQ/rUxiNS4bZTvx5QJSWNgZMqPFMJomGKob4=
22-
github.com/marstr/envelopes v0.5.1-0.20250706052704-abd708bd96d8 h1:0qBnE35xefUbdmuf9+svFCz/4jRg6G7XQmxFbyBWwCM=
23-
github.com/marstr/envelopes v0.5.1-0.20250706052704-abd708bd96d8/go.mod h1:ejfyNhHkqWnJaxWANdGIjn+iSqrIDqyRLxGnIV8q9lY=
22+
github.com/marstr/envelopes v0.5.1-0.20250724195254-1badb247f40f h1:2TVNx+IIL4AqX7ysPTObFmLfGDJCb74uPfaErrgRzBQ=
23+
github.com/marstr/envelopes v0.5.1-0.20250724195254-1badb247f40f/go.mod h1:ejfyNhHkqWnJaxWANdGIjn+iSqrIDqyRLxGnIV8q9lY=
2424
github.com/marstr/units v1.0.1 h1:J1oBku8rInztZY9IO0W2fS1bZ60UotlmBLbyvyZLoSU=
2525
github.com/marstr/units v1.0.1/go.mod h1:B1/IxDKETT7FwLuU0ZOvdPePP9chjt0PLTt+qeVARJ8=
2626
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=

0 commit comments

Comments
 (0)