aboutsummaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2022-12-29 10:49:24 +0100
committerGitHub <noreply@github.com>2022-12-29 10:49:24 +0100
commit2a62c131a25e03fc791ff066563a564c7cb8b879 (patch)
tree378b255e07158643e5a498c50a62bf2241181ebf /commands
parentd11ea5c2adec0fd92be30d3e3bdd1b5679d4118c (diff)
parentc9009b52990d86c6d2589b786b6545488e8ae6ef (diff)
downloadgit-bug-2a62c131a25e03fc791ff066563a564c7cb8b879.tar.gz
Merge pull request #965 from MichaelMure/nitpic
commands: don't double build the lamport clocks
Diffstat (limited to 'commands')
-rw-r--r--commands/execenv/env.go7
-rw-r--r--commands/root.go3
2 files changed, 5 insertions, 5 deletions
diff --git a/commands/execenv/env.go b/commands/execenv/env.go
index 9b71a45a..b383dde0 100644
--- a/commands/execenv/env.go
+++ b/commands/execenv/env.go
@@ -8,7 +8,6 @@ import (
"github.com/spf13/cobra"
"github.com/MichaelMure/git-bug/cache"
- "github.com/MichaelMure/git-bug/entities/bug"
"github.com/MichaelMure/git-bug/entities/identity"
"github.com/MichaelMure/git-bug/repository"
"github.com/MichaelMure/git-bug/util/interrupt"
@@ -87,11 +86,13 @@ func LoadRepo(env *Env) func(*cobra.Command, []string) error {
return fmt.Errorf("unable to get the current working directory: %q", err)
}
- env.Repo, err = repository.OpenGoGitRepo(cwd, gitBugNamespace, []repository.ClockLoader{bug.ClockLoader})
+ // Note: we are not loading clocks here because we assume that LoadRepo is only used
+ // when we don't manipulate entities, or as a child call of LoadBackend which will
+ // read all clocks anyway.
+ env.Repo, err = repository.OpenGoGitRepo(cwd, gitBugNamespace, nil)
if err == repository.ErrNotARepo {
return fmt.Errorf("%s must be run from within a git Repo", RootCommandName)
}
-
if err != nil {
return err
}
diff --git a/commands/root.go b/commands/root.go
index d98f9448..cb4fd686 100644
--- a/commands/root.go
+++ b/commands/root.go
@@ -8,10 +8,9 @@ import (
"github.com/spf13/cobra"
"github.com/MichaelMure/git-bug/commands/bridge"
- usercmd "github.com/MichaelMure/git-bug/commands/user"
-
"github.com/MichaelMure/git-bug/commands/bug"
"github.com/MichaelMure/git-bug/commands/execenv"
+ "github.com/MichaelMure/git-bug/commands/user"
)
// These variables are initialized externally during the build. See the Makefile.