cob: mandatory Oid in CodeLocation

To make `CodeLocation` reusable across different components, require
that a commit's `Oid` is part of the struct.

An `Oid` is necessary since the `path` can refer to a path at any
point in time throughout the history of the repository. By pinning the
commit that is being referred to, the path will refer to the path
within the associated tree [of the commit].

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
This commit is contained in:
Fintan Halpenny
2023-12-22 15:00:42 +01:00
committed by cloudhead
parent 1a63024a58
commit 2cbfb6dd53
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ use std::path::Path;
use std::str;
use base64::prelude::{Engine, BASE64_STANDARD};
use radicle::patch::CodeLocation;
use radicle::cob::CodeLocation;
use serde_json::{json, Value};
use radicle::cob::issue::{Issue, IssueId};
+3 -1
View File
@@ -3111,6 +3111,7 @@ mod routes {
}
],
"location": {
"commit": HEAD,
"path": "README.md",
"new": {
"type": "lines",
@@ -3224,7 +3225,7 @@ mod routes {
"summary": "A small review",
"comments": [
{
"id": "b108acfd2117480fd87012a5ab7cb69a0651d933",
"id": "2ed1c517997d3f1a83c6830ebab069c6e2ee967e",
"author": {
"id": "did:key:z6Mkk7oqY4pPxhMmGEotDYsFo97vhCj85BLY1H256HrJmjN8",
},
@@ -3272,6 +3273,7 @@ mod routes {
"timestamp": 1671125284,
"replyTo": null,
"location": {
"commit": HEAD,
"path": "README.md",
"old": null,
"new": {