Skip to content

Commit

Permalink
Don't ask confirmation when pinning a new package
Browse files Browse the repository at this point in the history
Co-authored-by: R. Boujbel <[email protected]>
  • Loading branch information
kit-ty-kate and rjbou committed Feb 4, 2025
1 parent d2f2e6b commit 9e214de
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ users)
## Pin
* [NEW] Make it so pin list display the current revision of a pinned repository in a new column [#6274 @desumn - fix #5533]
* [BUG] Stop double pin of packages located in ./opam/opam [#6343 @kit-ty-kate - fix #6342]
* Don't ask confirmation when pinning an unknown package (absent from repositories) [#6309 @kit-ty-kate @rjbou - fix #3199]

## List

Expand Down
10 changes: 4 additions & 6 deletions src/client/opamPinCommand.ml
Original file line number Diff line number Diff line change
Expand Up @@ -491,12 +491,10 @@ and source_pin
version, None
in

if not (OpamPackage.has_name st.packages name) &&
not (OpamConsole.confirm
"Package %s does not exist, create as a %s package?"
(OpamPackage.Name.to_string name)
(OpamConsole.colorise `bold "NEW"))
then raise Aborted;
if not (OpamPackage.has_name st.packages name) then
OpamConsole.note "Package %s does not exist in opam repositories \
registered in the current switch."
(OpamPackage.Name.to_string name);

(match OpamStd.Option.map OpamFile.URL.url cur_urlf, target_url with
| Some u, Some target when OpamUrl.(
Expand Down

0 comments on commit 9e214de

Please sign in to comment.