Skip to content

Commit bf6b2ad

Browse files
committed
git, hg: Use full revision
Before, the revision was at most the first 8 bytes in the revision. This can be problematic for reproducibility since the revision may then be ambiguous.
1 parent 4f0bd71 commit bf6b2ad

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/repository/opamGit.ml

+1-4
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,7 @@ module VCS : OpamVCS.VCS = struct
159159
match r.OpamProcess.r_stdout with
160160
| [] -> Done None
161161
| full::_ ->
162-
if String.length full > 8 then
163-
Done (Some (String.sub full 0 8))
164-
else
165-
Done (Some full))
162+
Done (Some full))
166163

167164
let clean repo_root =
168165
git repo_root [ "clean"; "-fdx" ]

src/repository/opamHg.ml

+1-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ module VCS = struct
5353
match r.OpamProcess.r_stdout with
5454
| [] -> Done None
5555
| full::_ ->
56-
if String.length full > 8 then Done (Some (String.sub full 0 8))
57-
else Done (Some full)
56+
Done (Some full)
5857

5958
let clean repo_root =
6059
hg repo_root ["revert"; "--all"; "--no-backup"]

0 commit comments

Comments
 (0)