Skip to content

Commit

Permalink
Merge pull request #97 from tphoney/add_hashblob_findfile
Browse files Browse the repository at this point in the history
(feat) gitlab contents.Find returns hash/blob
  • Loading branch information
bradrydzewski authored Mar 16, 2021
2 parents 02f5d30 + 9f58e9d commit 146853b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions scm/driver/gitlab/content.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ func (s *contentService) Find(ctx context.Context, repo, path, ref string) (*scm
return &scm.Content{
Path: out.FilePath,
Data: raw,
Hash: out.BlobID,
}, res, err
}

Expand Down
3 changes: 2 additions & 1 deletion scm/driver/gitlab/testdata/content.json.golden
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"Path": "app/models/key.rb",
"Data": "cmVxdWlyZSAnZGlnZXN0L21kNScKCmNsYXNzIEtleSA8IEFjdGl2ZVJlY29yZDo6QmFzZQogIGluY2x1ZGUgR2l0bGFiOjpDdXJyZW50U2V0dGluZ3MKICBpbmNsdWRlIFNvcnRhYmxlCgogIGJlbG9uZ3NfdG8gOnVzZXIKCiAgYmVmb3JlX3ZhbGlkYXRpb24gOmdlbmVyYXRlX2ZpbmdlcnByaW50CgogIHZhbGlkYXRlcyA6dGl0bGUsCiAgICBwcmVzZW5jZTogdHJ1ZSwKICAgIGxlbmd0aDogeyBtYXhpbXVtOiAyNTUgfQoKICB2YWxpZGF0ZXMgOmtleSwKICAgIHByZXNlbmNlOiB0cnVlLAogICAgbGVuZ3RoOiB7IG1heGltdW06IDUwMDAgfSwKICAgIGZvcm1hdDogeyB3aXRoOiAvXEEoc3NofGVjZHNhKS0uKlxaLyB9CgogIHZhbGlkYXRlcyA6ZmluZ2VycHJpbnQsCiAgICB1bmlxdWVuZXNzOiB0cnVlLAogICAgcHJlc2VuY2U6IHsgbWVzc2FnZTogJ2Nhbm5vdCBiZSBnZW5lcmF0ZWQnIH0KCiAgdmFsaWRhdGUgOmtleV9tZWV0c19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