summaryrefslogtreecommitdiff
path: root/lib/prefetch.ml
diff options
context:
space:
mode:
authorยท๐‘‘๐‘ด๐‘•๐‘‘๐‘ฉ๐‘ค2025-12-30 14:58:23 +0000
committerยท๐‘‘๐‘ด๐‘•๐‘‘๐‘ฉ๐‘ค2025-12-30 14:58:23 +0000
commit403bebbc8daeec3b04998ccdb5b243255705e445 (patch)
tree5ff081422f47d5c256a2fe0cffd58d0962a8c8e3 /lib/prefetch.ml
parent51b29e579692317725b6020075007cbec403ee19 (diff)
downloadnixtaml-403bebbc8daeec3b04998ccdb5b243255705e445.tar
nixtaml-403bebbc8daeec3b04998ccdb5b243255705e445.tar.gz
nixtaml-403bebbc8daeec3b04998ccdb5b243255705e445.tar.bz2
nixtaml-403bebbc8daeec3b04998ccdb5b243255705e445.tar.lz
nixtaml-403bebbc8daeec3b04998ccdb5b243255705e445.tar.xz
nixtaml-403bebbc8daeec3b04998ccdb5b243255705e445.tar.zst
nixtaml-403bebbc8daeec3b04998ccdb5b243255705e445.zip
prefetch: paths
Diffstat (limited to 'lib/prefetch.ml')
-rw-r--r--lib/prefetch.ml18
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/prefetch.ml b/lib/prefetch.ml
index d5351e9..3cc4c2f 100644
--- a/lib/prefetch.ml
+++ b/lib/prefetch.ml
@@ -30,6 +30,7 @@ end
module Git = struct
type t = {
datetime: string option;
+ path: string;
rev: string;
hash: Hash.t;
}
@@ -39,10 +40,11 @@ module Git = struct
let open Jsont in
Object.map
~kind: "Prefetch_Git"
- (fun datetime rev blake3 sha256 sha512 ->
+ (fun path datetime rev blake3 sha256 sha512 ->
let hash = Hash.make_from_opts blake3 sha256 sha512 in
- make ?datetime ~rev ~hash ()
+ make ~path ?datetime ~rev ~hash ()
)
+ |> Object.mem "path" string ~enc: (fun i -> i.path)
|> Object.opt_mem "date" string ~enc: (fun i -> i.datetime)
|> Object.mem "rev" string ~enc: (fun i -> i.rev)
|> Hash.add_jsont_case
@@ -51,6 +53,7 @@ end
module Darcs = struct
type t = {
+ path: string;
datetime: string option;
context: string;
weak_hash: string;
@@ -62,10 +65,11 @@ module Darcs = struct
let open Jsont in
Object.map
~kind: "Prefetch_Darcs"
- (fun datetime context weak_hash blake3 sha256 sha512 ->
+ (fun path datetime context weak_hash blake3 sha256 sha512 ->
let hash = Hash.make_from_opts blake3 sha256 sha512 in
- make ?datetime ~context ~weak_hash ~hash ()
+ make ~path ?datetime ~context ~weak_hash ~hash ()
)
+ |> Object.mem "path" string ~enc: (fun i -> i.path)
|> Object.opt_mem "date" string ~enc: (fun i -> i.datetime)
|> Object.mem "context" string ~enc: (fun i -> i.context)
|> Object.mem "weak-hash" string ~enc: (fun i -> i.weak_hash)
@@ -75,6 +79,7 @@ end
module Pijul = struct
type t = {
+ path: string;
datetime: string option;
state: string;
hash: Hash.t
@@ -85,10 +90,11 @@ module Pijul = struct
let open Jsont in
Object.map
~kind: "Prefetch_Pijul"
- (fun datetime state blake3 sha256 sha512 ->
+ (fun path datetime state blake3 sha256 sha512 ->
let hash = Hash.make_from_opts blake3 sha256 sha512 in
- make ?datetime ~state ~hash ()
+ make ~path ?datetime ~state ~hash ()
)
+ |> Object.mem "path" string ~enc: (fun i -> i.path)
|> Object.opt_mem "date" string ~enc: (fun i -> i.datetime)
|> Object.mem "state" string ~enc: (fun i -> i.state)
|> Hash.add_jsont_case