Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix generation of temporary path with a looooong name #4590

Merged
merged 1 commit into from
Mar 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ New option/command/subcommand are prefixed with ◈.
*

## Internal
*
* Fix temporary file with a too long name causing errors on Windows [#4590 @AltGr]

## Test
*
Expand Down
8 changes: 5 additions & 3 deletions src/repository/opamRepositoryPath.ml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ let pin_cache_dir =

let pin_cache u =
pin_cache_dir () /
(OpamHash.contents @@
OpamHash.compute_from_string ~kind:`SHA512 @@
OpamUrl.to_string u)
String.sub
(OpamHash.contents @@
OpamHash.compute_from_string ~kind:`SHA512 @@
OpamUrl.to_string u)
0 16

let repo repo_root = repo_root // "repo" |> OpamFile.make

Expand Down