Persistent store with Git semantics: lazy reads, delayed writes, content-addressing
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

irmin: rename Heap.find_ref to Heap.ref

ref is not an OCaml keyword (it's a Stdlib function), so it's a
valid name in a different module. Drops the redundant find_ prefix
per merlint E331.

+15 -18
+1 -1
bin/cmd_proof.ml
··· 87 87 let put tbl h data = Hashtbl.replace tbl (key h) data 88 88 let mem tbl h = Hashtbl.mem tbl (key h) 89 89 let batch tbl l = List.iter (fun (h, data) -> put tbl h data) l 90 - let find_ref _ _ = None 90 + let ref _ _ = None 91 91 let set_ref _ _ _ = () 92 92 let del_ref _ _ = () 93 93 let list_refs _ = []
+1 -1
lib/atproto/irmin_atproto.ml
··· 94 94 let put t h d = t#put h d 95 95 let mem t h = t#has h 96 96 let batch t l = List.iter (fun (h, d) -> t#put h d) l 97 - let find_ref _ _ = None 97 + let ref _ _ = None 98 98 let set_ref _ _ _ = () 99 99 let del_ref _ _ = () 100 100 let list_refs _ = []
+1 -4
lib/git/irmin_git.ml
··· 124 124 125 125 let mem repo h = Git.Repository.exists repo (git_hash h) 126 126 let batch repo l = List.iter (fun (h, data) -> put repo h data) l 127 - 128 - let find_ref repo name = 129 - Option.map irmin_hash (Git.Repository.read_ref repo name) 130 - 127 + let ref repo name = Option.map irmin_hash (Git.Repository.read_ref repo name) 131 128 let set_ref repo name h = Git.Repository.write_ref repo name (git_hash h) 132 129 let del_ref repo name = Git.Repository.delete_ref repo name 133 130 let list_refs repo = Git.Repository.list_refs repo
+6 -6
lib/heap.ml
··· 7 7 val put : t -> hash -> block -> unit 8 8 val mem : t -> hash -> bool 9 9 val batch : t -> (hash * block) list -> unit 10 - val find_ref : t -> string -> hash option 10 + val ref : t -> string -> hash option 11 11 val set_ref : t -> string -> hash -> unit 12 12 val del_ref : t -> string -> unit 13 13 val list_refs : t -> string list ··· 21 21 put : 'h -> 'v -> unit; 22 22 mem : 'h -> bool; 23 23 batch : ('h * 'v) list -> unit; 24 - find_ref : string -> 'h option; 24 + ref : string -> 'h option; 25 25 set_ref : string -> 'h -> unit; 26 26 del_ref : string -> unit; 27 27 list_refs : unit -> string list; ··· 35 35 let put t h data = t.put h data 36 36 let mem t h = t.mem h 37 37 let batch t l = t.batch l 38 - let find_ref t name = t.find_ref name 38 + let ref t name = t.ref name 39 39 let set_ref t name h = t.set_ref name h 40 40 let del_ref t name = t.del_ref name 41 41 let list_refs t = t.list_refs () ··· 52 52 put = B.put s; 53 53 mem = B.mem s; 54 54 batch = B.batch s; 55 - find_ref = B.find_ref s; 55 + ref = B.ref s; 56 56 set_ref = B.set_ref s; 57 57 del_ref = B.del_ref s; 58 58 list_refs = (fun () -> B.list_refs s); ··· 77 77 put = t.put; 78 78 mem = t.mem; 79 79 batch = t.batch; 80 - find_ref = t.find_ref; 80 + ref = t.ref; 81 81 set_ref = t.set_ref; 82 82 del_ref = t.del_ref; 83 83 list_refs = t.list_refs; ··· 102 102 put = (fun _ _ -> ()); 103 103 mem = (fun h -> Option.is_some (find h)); 104 104 batch = (fun _ -> ()); 105 - find_ref = (fun _ -> None); 105 + ref = (fun _ -> None); 106 106 set_ref = (fun _ _ -> ()); 107 107 del_ref = (fun _ -> ()); 108 108 list_refs = (fun () -> []);
+3 -3
lib/heap.mli
··· 47 47 48 48 Mutable pointers into the heap. Used for branches, HEAD, etc. *) 49 49 50 - val find_ref : ('h, _, _) t -> string -> 'h option 51 - (** [find_ref heap name] is the hash bound to [name], if any. *) 50 + val ref : ('h, _, _) t -> string -> 'h option 51 + (** [ref heap name] is the hash bound to [name], if any. *) 52 52 53 53 val set_ref : ('h, _, _) t -> string -> 'h -> unit 54 54 (** [set_ref heap name h] binds [name] to [h]. *) ··· 92 92 val batch : t -> (hash * block) list -> unit 93 93 (** Store many blocks. *) 94 94 95 - val find_ref : t -> string -> hash option 95 + val ref : t -> string -> hash option 96 96 (** Look up a named ref. *) 97 97 98 98 val set_ref : t -> string -> hash -> unit
+1 -1
lib/schema.ml
··· 367 367 368 368 (* ===== Refs ===== *) 369 369 370 - let head heap ~branch = Heap.find_ref heap ("refs/heads/" ^ branch) 370 + let head heap ~branch = Heap.ref heap ("refs/heads/" ^ branch) 371 371 let set_head heap ~branch h = Heap.set_ref heap ("refs/heads/" ^ branch) h 372 372 373 373 let branches heap =
+1 -1
test/mst_proof/mst_proof.ml
··· 19 19 let put t h d = Hashtbl.replace t h d 20 20 let mem t h = Hashtbl.mem t h 21 21 let batch t l = List.iter (fun (h, d) -> Hashtbl.replace t h d) l 22 - let find_ref _ _ = None 22 + let ref _ _ = None 23 23 let set_ref _ _ _ = () 24 24 let del_ref _ _ = () 25 25 let list_refs _ = []
+1 -1
test/tar/test.ml
··· 15 15 let put t h d = Hashtbl.replace t h d 16 16 let mem t h = Hashtbl.mem t h 17 17 let batch t l = List.iter (fun (h, d) -> Hashtbl.replace t h d) l 18 - let find_ref _ _ = None 18 + let ref _ _ = None 19 19 let set_ref _ _ _ = () 20 20 let del_ref _ _ = () 21 21 let list_refs _ = []