Skip to content
Closed
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
5 changes: 3 additions & 2 deletions doc/changes/fixed/16623.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
- Do not report unrelated git remote errors as "revision does not exist"
(#16623, fixes #16466, @mefyl)
- Do not report unrelated git remote errors as "revision does not exist", make
the git error more readable in the error message (#16623, #16628, fixes
#16466, @mefyl)
12 changes: 8 additions & 4 deletions src/dune_pkg/opamUrl0.ml
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,19 @@ let not_found ~loc t revision =
;;

let fetch_failed ~loc ~git_output t obj =
let git_output = List.map ~f:Pp.verbatim git_output in
let git_output =
List.map ~f:Pp.(Pp.verbatimf "git| %s")
@@ List.concat
@@ List.map ~f:(fun line -> String.split ~on:'\n' @@ String.trim line) git_output
in
Error
(User_message.make ~loc
@@ git_output
@ [ Pp.textf
@@ (Pp.textf
"could not fetch revision %S from %s"
(Rev_store.Object.to_hex obj)
(base_url t)
])
:: Pp.text ""
:: git_output))
;;

let resolve t ~loc rev_store =
Expand Down
Loading