@@ -25,7 +25,7 @@ let read_tree_exn t sha =
25
25
module String = struct
26
26
include String
27
27
28
- let start_with prefix s =
28
+ let starting ~ w : prefix s =
29
29
if String. length prefix < = String. length s then
30
30
try
31
31
for i = 0 to String. length prefix - 1 do
@@ -35,7 +35,7 @@ module String = struct
35
35
with Exit -> false
36
36
else false
37
37
38
- let end_with postfix s =
38
+ let ending ~ w : postfix s =
39
39
let ofs = String. length s - String. length postfix in
40
40
if ofs > = 0 then
41
41
try
@@ -379,7 +379,7 @@ module Tag = struct
379
379
date = Calendar. from_unixfloat (Int64. to_float t) }
380
380
381
381
let get_ref t r =
382
- if String. start_with " refs/tags/" (Git.Reference. to_raw r) then
382
+ if String. starting ~w: " refs/tags/" (Git.Reference. to_raw r) then
383
383
Store. read_reference_exn t r >> = fun sha ->
384
384
Store. read_exn t (Git.SHA. of_commit sha) > |= fun v ->
385
385
match v with
@@ -500,9 +500,9 @@ let get_store ?(repo_dir="repo") ?(update=false) remote_uri =
500
500
type classification = | OCaml | C
501
501
| Undecided of string
502
502
503
- let is_ml e = Git.Tree. (e.perm = `Normal && String. end_with " .ml" e.name)
503
+ let is_ml e = Git.Tree. (e.perm = `Normal && String. ending ~w: " .ml" e.name)
504
504
505
- let is_c e = Git.Tree. (e.perm = `Normal && String. end_with " .c" e.name)
505
+ let is_c e = Git.Tree. (e.perm = `Normal && String. ending ~w: " .c" e.name)
506
506
507
507
let is_src e = Git.Tree. (e.perm = `Dir && (e.name = " src" || e.name = " lib" ))
508
508
0 commit comments