From 9f58e9df3ec0fa117d27e1eff83f6c24a60d9d0c Mon Sep 17 00:00:00 2001 From: TP Honey Date: Tue, 16 Mar 2021 16:33:32 +0000 Subject: [PATCH] (feat) gitlab contents.Find returns hash/blob --- scm/driver/gitlab/content.go | 1 + scm/driver/gitlab/testdata/content.json.golden | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/scm/driver/gitlab/content.go b/scm/driver/gitlab/content.go index f4263489c..196c593ee 100644 --- a/scm/driver/gitlab/content.go +++ b/scm/driver/gitlab/content.go @@ -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 } diff --git a/scm/driver/gitlab/testdata/content.json.golden b/scm/driver/gitlab/testdata/content.json.golden index 73abcc029..c8e3a8c25 100644 --- a/scm/driver/gitlab/testdata/content.json.golden +++ b/scm/driver/gitlab/testdata/content.json.golden @@ -1,4 +1,5 @@ { "Path": "app/models/key.rb", - "Data": "cmVxdWlyZSAnZGlnZXN0L21kNScKCmNsYXNzIEtleSA8IEFjdGl2ZVJlY29yZDo6QmFzZQogIGluY2x1ZGUgR2l0bGFiOjpDdXJyZW50U2V0dGluZ3MKICBpbmNsdWRlIFNvcnRhYmxlCgogIGJlbG9uZ3NfdG8gOnVzZXIKCiAgYmVmb3JlX3ZhbGlkYXRpb24gOmdlbmVyYXRlX2ZpbmdlcnByaW50CgogIHZhbGlkYXRlcyA6dGl0bGUsCiAgICBwcmVzZW5jZTogdHJ1ZSwKICAgIGxlbmd0aDogeyBtYXhpbXVtOiAyNTUgfQoKICB2YWxpZGF0ZXMgOmtleSwKICAgIHByZXNlbmNlOiB0cnVlLAogICAgbGVuZ3RoOiB7IG1heGltdW06IDUwMDAgfSwKICAgIGZvcm1hdDogeyB3aXRoOiAvXEEoc3NofGVjZHNhKS0uKlxaLyB9CgogIHZhbGlkYXRlcyA6ZmluZ2VycHJpbnQsCiAgICB1bmlxdWV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