diff options
author | Michael Muré <batolettre@gmail.com> | 2018-07-12 15:14:37 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-07-12 21:32:09 +0200 |
commit | cda8114fda8d349bbaeefb42cc33ba715d41cf08 (patch) | |
tree | 45c96a8d07db89ff66519ae1e29b44648c1b5e37 /repository/git.go | |
parent | df67212fee5ae5381b13b2c7d6ce92e1bdb66e0f (diff) | |
download | git-bug-cda8114fda8d349bbaeefb42cc33ba715d41cf08.tar.gz |
store user info in the datastore
Diffstat (limited to 'repository/git.go')
-rw-r--r-- | repository/git.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/repository/git.go b/repository/git.go index 309641f6..679d24fc 100644 --- a/repository/git.go +++ b/repository/git.go @@ -114,6 +114,17 @@ func (repo *GitRepo) PushRefs(remote string, refPattern string) error { return nil } +// StoreData will store arbitrary data and return the corresponding hash +func (repo *GitRepo) StoreData(data []byte) (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 +} + /* // //// GetSubmitStrategy returns the way in which a review is submitted |