httpd: Add commit parents vector to `/commits/:sha` endpoint
So we can act upon the eventual parents of a commit, after fetching a single commit we need to have the parents of that commit as part of the json payload. Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
This commit is contained in:
parent
41bff1b3bb
commit
5cb4d5cd76
|
|
@ -33,6 +33,7 @@ pub(crate) fn commit(commit: &Commit) -> Value {
|
||||||
},
|
},
|
||||||
"summary": commit.summary,
|
"summary": commit.summary,
|
||||||
"description": commit.description(),
|
"description": commit.description(),
|
||||||
|
"parents": commit.parents,
|
||||||
"committer": {
|
"committer": {
|
||||||
"name": commit.committer.name,
|
"name": commit.committer.name,
|
||||||
"email": commit.committer.email,
|
"email": commit.committer.email,
|
||||||
|
|
|
||||||
|
|
@ -869,6 +869,9 @@ mod routes {
|
||||||
},
|
},
|
||||||
"summary": "Add another folder",
|
"summary": "Add another folder",
|
||||||
"description": "",
|
"description": "",
|
||||||
|
"parents": [
|
||||||
|
"ee8d6a29304623a78ebfa5eeed5af674d0e58f83",
|
||||||
|
],
|
||||||
"committer": {
|
"committer": {
|
||||||
"name": "Alice Liddell",
|
"name": "Alice Liddell",
|
||||||
"email": "alice@radicle.xyz",
|
"email": "alice@radicle.xyz",
|
||||||
|
|
@ -995,6 +998,9 @@ mod routes {
|
||||||
},
|
},
|
||||||
"summary": "Add contributing file",
|
"summary": "Add contributing file",
|
||||||
"description": "",
|
"description": "",
|
||||||
|
"parents": [
|
||||||
|
"f604ce9fd5b7cc77b7609beda45ea8760bee78f7",
|
||||||
|
],
|
||||||
"committer": {
|
"committer": {
|
||||||
"name": "Alice Liddell",
|
"name": "Alice Liddell",
|
||||||
"email": "alice@radicle.xyz",
|
"email": "alice@radicle.xyz",
|
||||||
|
|
@ -1090,6 +1096,7 @@ mod routes {
|
||||||
},
|
},
|
||||||
"summary": "Initial commit",
|
"summary": "Initial commit",
|
||||||
"description": "",
|
"description": "",
|
||||||
|
"parents": [],
|
||||||
"committer": {
|
"committer": {
|
||||||
"name": "Alice Liddell",
|
"name": "Alice Liddell",
|
||||||
"email": "alice@radicle.xyz",
|
"email": "alice@radicle.xyz",
|
||||||
|
|
@ -1172,6 +1179,9 @@ mod routes {
|
||||||
},
|
},
|
||||||
"summary": "Add another folder",
|
"summary": "Add another folder",
|
||||||
"description": "",
|
"description": "",
|
||||||
|
"parents": [
|
||||||
|
"ee8d6a29304623a78ebfa5eeed5af674d0e58f83",
|
||||||
|
],
|
||||||
"committer": {
|
"committer": {
|
||||||
"name": "Alice Liddell",
|
"name": "Alice Liddell",
|
||||||
"email": "alice@radicle.xyz",
|
"email": "alice@radicle.xyz",
|
||||||
|
|
@ -1322,6 +1332,9 @@ mod routes {
|
||||||
},
|
},
|
||||||
"summary": "Add another folder",
|
"summary": "Add another folder",
|
||||||
"description": "",
|
"description": "",
|
||||||
|
"parents": [
|
||||||
|
"ee8d6a29304623a78ebfa5eeed5af674d0e58f83",
|
||||||
|
],
|
||||||
"committer": {
|
"committer": {
|
||||||
"name": "Alice Liddell",
|
"name": "Alice Liddell",
|
||||||
"email": "alice@radicle.xyz",
|
"email": "alice@radicle.xyz",
|
||||||
|
|
@ -1331,8 +1344,8 @@ mod routes {
|
||||||
"name": "",
|
"name": "",
|
||||||
"path": "",
|
"path": "",
|
||||||
"stats": {
|
"stats": {
|
||||||
"commits": 3,
|
|
||||||
"branches": 1,
|
"branches": 1,
|
||||||
|
"commits": 3,
|
||||||
"contributors": 1
|
"contributors": 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1360,6 +1373,9 @@ mod routes {
|
||||||
},
|
},
|
||||||
"summary": "Add another folder",
|
"summary": "Add another folder",
|
||||||
"description": "",
|
"description": "",
|
||||||
|
"parents": [
|
||||||
|
"ee8d6a29304623a78ebfa5eeed5af674d0e58f83",
|
||||||
|
],
|
||||||
"committer": {
|
"committer": {
|
||||||
"name": "Alice Liddell",
|
"name": "Alice Liddell",
|
||||||
"email": "alice@radicle.xyz",
|
"email": "alice@radicle.xyz",
|
||||||
|
|
@ -1369,8 +1385,8 @@ mod routes {
|
||||||
"name": "dir1",
|
"name": "dir1",
|
||||||
"path": "dir1",
|
"path": "dir1",
|
||||||
"stats": {
|
"stats": {
|
||||||
"branches": 1,
|
|
||||||
"commits": 3,
|
"commits": 3,
|
||||||
|
"branches": 1,
|
||||||
"contributors": 1
|
"contributors": 1
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -1442,6 +1458,9 @@ mod routes {
|
||||||
},
|
},
|
||||||
"summary": "Add another folder",
|
"summary": "Add another folder",
|
||||||
"description": "",
|
"description": "",
|
||||||
|
"parents": [
|
||||||
|
"ee8d6a29304623a78ebfa5eeed5af674d0e58f83"
|
||||||
|
],
|
||||||
"committer": {
|
"committer": {
|
||||||
"name": "Alice Liddell",
|
"name": "Alice Liddell",
|
||||||
"email": "alice@radicle.xyz",
|
"email": "alice@radicle.xyz",
|
||||||
|
|
@ -1464,7 +1483,8 @@ mod routes {
|
||||||
response.json().await,
|
response.json().await,
|
||||||
json!({
|
json!({
|
||||||
"binary": false,
|
"binary": false,
|
||||||
"content": "Hello World!\n",
|
"name": "README",
|
||||||
|
"path": "README",
|
||||||
"lastCommit": {
|
"lastCommit": {
|
||||||
"id": INITIAL_COMMIT,
|
"id": INITIAL_COMMIT,
|
||||||
"author": {
|
"author": {
|
||||||
|
|
@ -1473,14 +1493,14 @@ mod routes {
|
||||||
},
|
},
|
||||||
"summary": "Initial commit",
|
"summary": "Initial commit",
|
||||||
"description": "",
|
"description": "",
|
||||||
|
"parents": [],
|
||||||
"committer": {
|
"committer": {
|
||||||
"name": "Alice Liddell",
|
"name": "Alice Liddell",
|
||||||
"email": "alice@radicle.xyz",
|
"email": "alice@radicle.xyz",
|
||||||
"time": 1673001014
|
"time": 1673001014
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"name": "README",
|
"content": "Hello World!\n"
|
||||||
"path": "README"
|
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -1552,6 +1572,9 @@ mod routes {
|
||||||
},
|
},
|
||||||
"summary": "Add another folder",
|
"summary": "Add another folder",
|
||||||
"description": "",
|
"description": "",
|
||||||
|
"parents": [
|
||||||
|
"ee8d6a29304623a78ebfa5eeed5af674d0e58f83"
|
||||||
|
],
|
||||||
"committer": {
|
"committer": {
|
||||||
"name": "Alice Liddell",
|
"name": "Alice Liddell",
|
||||||
"email": "alice@radicle.xyz",
|
"email": "alice@radicle.xyz",
|
||||||
|
|
@ -1566,6 +1589,9 @@ mod routes {
|
||||||
},
|
},
|
||||||
"summary": "Add contributing file",
|
"summary": "Add contributing file",
|
||||||
"description": "",
|
"description": "",
|
||||||
|
"parents": [
|
||||||
|
"f604ce9fd5b7cc77b7609beda45ea8760bee78f7",
|
||||||
|
],
|
||||||
"committer": {
|
"committer": {
|
||||||
"name": "Alice Liddell",
|
"name": "Alice Liddell",
|
||||||
"email": "alice@radicle.xyz",
|
"email": "alice@radicle.xyz",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue