`--working-dir` not working with `opam install`?
I have an opam package, let's call it pkg, pinned to both a remote and local git branch (git+file). Recently I needed to bump the version of one of its dependencies (say, coq), so I edited pkg.opam just locally to make the corresponding change under depends:: replaced "coq" { (= "8.16.1") | (= "dev")} with "coq" { (= "8.17.0") | (= "dev")}. Then I ran opam install ./pkg.opam file, but got
[NOTE] Ignoring uncommitted changes in /home/ricardo/pkg (`--working-dir' not active).
[pkg.~dev] synchronised (no changes)
[NOTE] Package pkg is already installed (current version is ~dev).
Then I tried opam install --working-dir ./pkg.opam but only got
[NOTE] Package pkg is already installed (current version is ~dev).
Then I did git commit pkg.opam, wrote a suitable commit message, and then when I ran opam install ./pkg.opam it did bump the version of coq and reinstalled pkg.
Shouldn't using --working-dir have done that without the need to commit, or did I misunderstand how it works?
Thanks
# opam config report
# opam-version 2.1.5
# self-upgrade no
# system arch=x86_64 os=linux os-distribution=ubuntu os-version=22.04
# solver builtin-mccs+glpk
# install-criteria -removed,-count[avoid-version,changed],-count[version-lag,request],-count[version-lag,changed],-count[missing-depexts,changed],-changed
# upgrade-criteria -removed,-count[avoid-version,changed],-count[version-lag,solution],-count[missing-depexts,changed],-new
# jobs 11
# repositories 2 (http), 5 (version-controlled) (default repo at 7e48cbfb)
# pinned 4 (git), 1 (rsync)
# current-switch [switch-name]
# ocaml:native true
# ocaml:native-tools true
# ocaml:native-dynlink true
# ocaml:stubsdir /home/ricardo/.opam/[switch-name]/lib/ocaml/stublibs:/home/ricardo/.opam/pkg/lib/ocaml
# ocaml:preinstalled false
# ocaml:compiler 4.14.1