Skip to content

Commit fd43673

Browse files
muirdmfacebook-github-bot
authored andcommitted
debuglfsrecv: fix a couple minor issues
Summary: - Change it to an optional-repo command which allows it to pull the lfs.url from the local repo config if present. - Use write_all instead of write to ensure everything is output. Reviewed By: quark-zju Differential Revision: D75792923 fbshipit-source-id: 03f524462af8973292af3e3c2241a336f89f7105
1 parent da2d7e9 commit fd43673

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • eden/scm/lib/commands/debugcommands/cmddebuglfsreceive/src

eden/scm/lib/commands/debugcommands/cmddebuglfsreceive/src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use clidispatch::abort;
1313
use clidispatch::abort_if;
1414
use cmdutil::ConfigSet;
1515
use cmdutil::Error;
16+
use cmdutil::Repo;
1617
use cmdutil::Result;
1718
use cmdutil::define_flags;
1819
use revisionstore::LfsRemote;
@@ -26,7 +27,7 @@ define_flags! {
2627
}
2728
}
2829

29-
pub fn run(ctx: ReqCtx<DebugLfsReceiveOpts>) -> Result<u8> {
30+
pub fn run(ctx: ReqCtx<DebugLfsReceiveOpts>, repo: Option<&Repo>) -> Result<u8> {
3031
let mut config = ConfigSet::wrap(ctx.config().clone());
3132

3233
abort_if!(
@@ -50,7 +51,7 @@ pub fn run(ctx: ReqCtx<DebugLfsReceiveOpts>) -> Result<u8> {
5051
lfs_remote.batch_fetch(
5152
FetchContext::default(),
5253
&HashSet::from([(sha256, size)]),
53-
|_sha, data| output.write(data.as_ref()).map_err(Into::into).map(|_| ()),
54+
|_sha, data| Ok(output.write_all(data.as_ref())?),
5455
|_sha, err| error = Some(err),
5556
)?;
5657

0 commit comments

Comments
 (0)