-
-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[clone] link up lean plumbing command with gitoxide-core: pack-receive
- Loading branch information
Showing
7 changed files
with
93 additions
and
3 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
pub mod explode; | ||
pub mod index; | ||
pub mod verify; | ||
|
||
pub mod receive; | ||
pub use receive::receive; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
use crate::OutputFormat; | ||
use git_features::progress::Progress; | ||
use std::{io, path::PathBuf, str::FromStr}; | ||
|
||
#[derive(PartialEq, Debug)] | ||
pub enum Protocol { | ||
V1, | ||
V2, | ||
} | ||
|
||
impl FromStr for Protocol { | ||
type Err = String; | ||
|
||
fn from_str(s: &str) -> Result<Self, Self::Err> { | ||
Ok(match s { | ||
"1" => Protocol::V1, | ||
"2" => Protocol::V2, | ||
_ => return Err(format!("Unsupported protocol version '{}', choose '1' or '2'", s)), | ||
}) | ||
} | ||
} | ||
|
||
pub struct Context<W: io::Write> { | ||
pub thread_limit: Option<usize>, | ||
pub format: OutputFormat, | ||
pub out: W, | ||
} | ||
|
||
pub fn receive<P, W: io::Write>( | ||
_protocol: Option<Protocol>, | ||
_url: &str, | ||
_directory: Option<PathBuf>, | ||
_progress: P, | ||
_ctx: Context<W>, | ||
) -> anyhow::Result<()> | ||
where | ||
P: Progress, | ||
<P as Progress>::SubProgress: Send + 'static, | ||
<<P as Progress>::SubProgress as Progress>::SubProgress: Send, | ||
{ | ||
unimplemented!("pack-receive") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters