]> git.proxmox.com Git - cargo.git/commitdiff
Auto merge of #3092 - jhbabon:fix/dont-panic-on-workspaces, r=alexcrichton
authorbors <bors@rust-lang.org>
Wed, 14 Sep 2016 20:27:39 +0000 (13:27 -0700)
committerGitHub <noreply@github.com>
Wed, 14 Sep 2016 20:27:39 +0000 (13:27 -0700)
FIX: Don't try to generate Gargo.lock on empty workspaces.

There was a `panic!` when the command `cargo update` was executed in a workspace like this:

    mkdir ws
    cd ws
    echo '[workspace]' > Cargo.toml
    cargo new p1
    cargo new p2
    cargo update

The problem is that cargo tries to generate the `Cargo.lock` file even if there aren't any members on the workspace.

This fix checks the existence of members in the workspace before trying to do anything so at least we report an error instead of throwing a `panic!`.

Issue related https://github.com/rust-lang/cargo/issues/3080


Trivial merge