diff options
author | Michael Muré <batolettre@gmail.com> | 2018-08-06 20:31:20 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-08-06 20:31:20 +0200 |
commit | 435be2b693aee89ed34a2d1e7291b3b141b19717 (patch) | |
tree | 89244a9dcb995c27002995e9f25f9be631101713 /commands/root.go | |
parent | 593891b8e01fd89866b30854a60aece1dad5f6ab (diff) | |
download | git-bug-435be2b693aee89ed34a2d1e7291b3b141b19717.tar.gz |
bug: add a Lamport logical clock to be able to sort bugs by creation time and edit time without having to rely on a timestamp
Diffstat (limited to 'commands/root.go')
-rw-r--r-- | commands/root.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/commands/root.go b/commands/root.go index cee39083..be258199 100644 --- a/commands/root.go +++ b/commands/root.go @@ -2,6 +2,7 @@ package commands import ( "fmt" + "github.com/MichaelMure/git-bug/bug" "github.com/MichaelMure/git-bug/repository" "github.com/spf13/cobra" "os" @@ -49,10 +50,13 @@ func loadRepo(cmd *cobra.Command, args []string) error { return fmt.Errorf("Unable to get the current working directory: %q\n", err) } - repo, err = repository.NewGitRepo(cwd) - if err != nil { + repo, err = repository.NewGitRepo(cwd, bug.Witnesser) + if err == repository.ErrNotARepo { return fmt.Errorf("%s must be run from within a git repo.\n", rootCommandName) + } + if err != nil { + return err } return nil |