Skip to content

Commit 66bfc8c

Browse files
committed
auto merge of #936 : alexcrichton/cargo/issue-923, r=brson
Closes #923
2 parents aa16a12 + 666c0e9 commit 66bfc8c

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/bin/owner.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use cargo::ops;
22
use cargo::core::MultiShell;
33
use cargo::util::{CliResult, CliError};
4-
use cargo::util::important_paths::find_root_manifest_for_cwd;
54

65
#[deriving(Decodable)]
76
struct Options {
@@ -36,7 +35,6 @@ versions, and also modify the set of owners, so take caution!
3635

3736
pub fn execute(options: Options, shell: &mut MultiShell) -> CliResult<Option<()>> {
3837
shell.set_verbose(options.flag_verbose);
39-
let root = try!(find_root_manifest_for_cwd(None));
4038
let opts = ops::OwnersOptions {
4139
krate: options.arg_crate,
4240
token: options.flag_token,
@@ -45,7 +43,7 @@ pub fn execute(options: Options, shell: &mut MultiShell) -> CliResult<Option<()>
4543
to_remove: options.flag_remove,
4644
list: options.flag_list,
4745
};
48-
try!(ops::modify_owners(&root, shell, &opts).map_err(|e| {
46+
try!(ops::modify_owners(shell, &opts).map_err(|e| {
4947
CliError::from_boxed(e, 101)
5048
}));
5149
Ok(None)

src/cargo/ops/registry.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use sources::{PathSource, RegistrySource};
1515
use util::config;
1616
use util::{CargoResult, human, internal, ChainError, ToUrl};
1717
use util::config::{Config, ConfigValue, Location};
18+
use util::important_paths::find_root_manifest_for_cwd;
1819

1920
pub struct RegistryConfig {
2021
pub index: Option<String>,
@@ -228,12 +229,12 @@ pub struct OwnersOptions {
228229
pub list: bool,
229230
}
230231

231-
pub fn modify_owners(manifest_path: &Path,
232-
shell: &mut MultiShell,
232+
pub fn modify_owners(shell: &mut MultiShell,
233233
opts: &OwnersOptions) -> CargoResult<()> {
234234
let name = match opts.krate {
235235
Some(ref name) => name.clone(),
236236
None => {
237+
let manifest_path = try!(find_root_manifest_for_cwd(None));
237238
let mut src = try!(PathSource::for_path(&manifest_path.dir_path()));
238239
try!(src.update());
239240
let pkg = try!(src.get_root_package());

0 commit comments

Comments
 (0)