diff options
author | Michael Muré <batolettre@gmail.com> | 2018-09-18 12:49:16 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-09-18 12:49:16 +0200 |
commit | 0d5998eb67f9bbf146e15a127a2d6a89aa14eab9 (patch) | |
tree | 1f9a61040bc5f84ef2b78199a9adf922b7f0441f /bug | |
parent | 5eaf9e83e7cd56b8bb4915193d13adfb60575b21 (diff) | |
download | git-bug-0d5998eb67f9bbf146e15a127a2d6a89aa14eab9.tar.gz |
commands: add a package to handle implicit bug selection
Diffstat (limited to 'bug')
-rw-r--r-- | bug/bug.go | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -27,6 +27,8 @@ const editClockEntryPattern = "edit-clock-%d" const idLength = 40 const humanIdLength = 7 +var ErrBugNotExist = errors.New("bug doesn't exist") + var _ Interface = &Bug{} // Bug hold the data of a bug thread, organized in a way close to @@ -106,7 +108,7 @@ func readBug(repo repository.Repo, ref string) (*Bug, error) { hashes, err := repo.ListCommits(ref) if err != nil { - return nil, err + return nil, ErrBugNotExist } refSplit := strings.Split(ref, "/") @@ -123,13 +125,12 @@ func readBug(repo repository.Repo, ref string) (*Bug, error) { // Load each OperationPack for _, hash := range hashes { entries, err := repo.ListEntries(hash) - - bug.lastCommit = hash - if err != nil { return nil, err } + bug.lastCommit = hash + var opsEntry repository.TreeEntry opsFound := false var rootEntry repository.TreeEntry |