aboutsummaryrefslogtreecommitdiffstats
path: root/repository
diff options
context:
space:
mode:
Diffstat (limited to 'repository')
-rw-r--r--repository/git.go5
-rw-r--r--repository/repo.go4
2 files changed, 5 insertions, 4 deletions
diff --git a/repository/git.go b/repository/git.go
index 679d24fc..b41bc95c 100644
--- a/repository/git.go
+++ b/repository/git.go
@@ -5,6 +5,7 @@ import (
"bytes"
"crypto/sha1"
"fmt"
+ "github.com/MichaelMure/git-bug/util"
"io"
"os"
"os/exec"
@@ -115,14 +116,14 @@ func (repo *GitRepo) PushRefs(remote string, refPattern string) error {
}
// StoreData will store arbitrary data and return the corresponding hash
-func (repo *GitRepo) StoreData(data []byte) (Hash, error) {
+func (repo *GitRepo) StoreData(data []byte) (util.Hash, error) {
var stdin = bytes.NewReader(data)
var stdout bytes.Buffer
var stderr bytes.Buffer
err := repo.runGitCommandWithIO(stdin, &stdout, &stderr, "hash-object", "--stdin", "-w")
- return Hash(stdout.String()), err
+ return util.Hash(stdout.String()), err
}
/*
diff --git a/repository/repo.go b/repository/repo.go
index ef7215ee..2611324f 100644
--- a/repository/repo.go
+++ b/repository/repo.go
@@ -1,7 +1,7 @@
// Package repository contains helper methods for working with a Git repo.
package repository
-type Hash string
+import "github.com/MichaelMure/git-bug/util"
// Repo represents a source code repository.
type Repo interface {
@@ -24,5 +24,5 @@ type Repo interface {
PushRefs(remote string, refPattern string) error
// StoreData will store arbitrary data and return the corresponding hash
- StoreData([]byte) (Hash, error)
+ StoreData([]byte) (util.Hash, error)
}