diff options
author | Michael Muré <batolettre@gmail.com> | 2022-07-31 14:38:32 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2022-07-31 14:38:32 +0200 |
commit | d179b8b7ec7815ccac73e00f35f5cfbdc4ddbe2e (patch) | |
tree | d3faa7217cb287c7b20f2769f5c5808373aca63b /bug/with_snapshot.go | |
parent | 3d454d9dc8ba2409046c0938618a70864e6eb8ef (diff) | |
download | git-bug-d179b8b7ec7815ccac73e00f35f5cfbdc4ddbe2e.tar.gz |
bug: fix an issue where Id would be used, then changed due to metadata
Diffstat (limited to 'bug/with_snapshot.go')
-rw-r--r-- | bug/with_snapshot.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/bug/with_snapshot.go b/bug/with_snapshot.go index 9b706d61..0474cac7 100644 --- a/bug/with_snapshot.go +++ b/bug/with_snapshot.go @@ -1,6 +1,8 @@ package bug -import "github.com/MichaelMure/git-bug/repository" +import ( + "github.com/MichaelMure/git-bug/repository" +) var _ Interface = &WithSnapshot{} @@ -10,11 +12,10 @@ type WithSnapshot struct { snap *Snapshot } -// Snapshot return the current snapshot -func (b *WithSnapshot) Snapshot() *Snapshot { +func (b *WithSnapshot) Compile() *Snapshot { if b.snap == nil { snap := b.Bug.Compile() - b.snap = &snap + b.snap = snap } return b.snap } |