diff --git a/cmd/pullrequest-init/disk.go b/cmd/pullrequest-init/disk.go index 6bef194f25a..f3d00f1575f 100644 --- a/cmd/pullrequest-init/disk.go +++ b/cmd/pullrequest-init/disk.go @@ -201,6 +201,8 @@ func FromDisk(path string) (*Resource, error) { return nil, err } + r.PR.Sha = r.PR.Head.Sha + return r, nil } diff --git a/cmd/pullrequest-init/disk_test.go b/cmd/pullrequest-init/disk_test.go index a3ceed29c8d..b5b91d53b64 100644 --- a/cmd/pullrequest-init/disk_test.go +++ b/cmd/pullrequest-init/disk_test.go @@ -310,6 +310,9 @@ func TestFromDisk(t *testing.T) { if diff := cmp.Diff(rsrc.PR.Head, head); diff != "" { t.Errorf("Get Head: -want +got: %s", diff) } + if diff := cmp.Diff(rsrc.PR.Sha, head.Sha); diff != "" { + t.Errorf("Get Sha: -want +got: %s", diff) + } // Check the comments commentMap := map[int]scm.Comment{}