aboutsummaryrefslogtreecommitdiffstats
path: root/bug
diff options
context:
space:
mode:
authorMichael Muré <michael.mure@consensys.net>2019-01-16 21:23:49 +0100
committerMichael Muré <batolettre@gmail.com>2019-03-01 22:35:37 +0100
commit06d9c6872655b85f1a47599add92d49d570e7b2e (patch)
treeeef3f140d726450d66e49b4225a527b1b93a62a5 /bug
parentfeab9412dffe5772048aad29893c4cb01d566387 (diff)
downloadgit-bug-06d9c6872655b85f1a47599add92d49d570e7b2e.tar.gz
identity: implement the loading from git
Diffstat (limited to 'bug')
-rw-r--r--bug/bug.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/bug/bug.go b/bug/bug.go
index b6d09c50..be3e2661 100644
--- a/bug/bug.go
+++ b/bug/bug.go
@@ -113,13 +113,6 @@ func ReadRemoteBug(repo repository.ClockedRepo, remote string, id string) (*Bug,
// readBug will read and parse a Bug from git
func readBug(repo repository.ClockedRepo, ref string) (*Bug, error) {
- hashes, err := repo.ListCommits(ref)
-
- // TODO: this is not perfect, it might be a command invoke error
- if err != nil {
- return nil, ErrBugNotExist
- }
-
refSplit := strings.Split(ref, "/")
id := refSplit[len(refSplit)-1]
@@ -127,6 +120,13 @@ func readBug(repo repository.ClockedRepo, ref string) (*Bug, error) {
return nil, fmt.Errorf("invalid ref length")
}
+ hashes, err := repo.ListCommits(ref)
+
+ // TODO: this is not perfect, it might be a command invoke error
+ if err != nil {
+ return nil, ErrBugNotExist
+ }
+
bug := Bug{
id: id,
}