summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJustin Wernick <justin@worthe-it.co.za>2023-03-16 22:51:00 +0200
committerJustin Wernick <justin@worthe-it.co.za>2023-03-16 22:51:00 +0200
commitb541b141e66d5cf0ba4b190eda6422126951af6e (patch)
tree7c183c941972266ffc14844ce48e39a5475ceff6 /src
parent3035f8d52efe33749a8c027e193559ee7dd4c357 (diff)
Git push
Diffstat (limited to 'src')
-rw-r--r--src/main.rs12
-rw-r--r--src/parser.rs8
2 files changed, 20 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 6f8c1d9..50f5127 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -78,6 +78,18 @@ fn run_command(user_input: String) -> Result<ControlFlow<(), ()>, ShackleError>
command.spawn()?.wait()?;
}
+ Ok(ShackleCommand::GitReceivePack(receive_pack_args)) => {
+ let mut command = Command::new("git-receive-pack");
+
+ if receive_pack_args.http_backend_info_refs {
+ command.arg("--http-backend-info-refs");
+ }
+
+ // TODO: This should definitely be part of the arg parsing!
+ command.arg(&receive_pack_args.directory.trim_matches('\''));
+
+ command.spawn()?.wait()?;
+ }
}
Ok(ControlFlow::Continue(()))
}
diff --git a/src/parser.rs b/src/parser.rs
index ef7d5f8..59dc7d8 100644
--- a/src/parser.rs
+++ b/src/parser.rs
@@ -9,6 +9,7 @@ pub enum ShackleCommand {
Exit,
GitInit(GitInitArgs),
GitUploadPack(GitUploadPackArgs),
+ GitReceivePack(GitReceivePackArgs),
}
#[derive(Subcommand, Clone, Debug, PartialEq, Eq)]
@@ -36,6 +37,13 @@ pub struct GitUploadPackArgs {
pub directory: String,
}
+#[derive(Parser, Clone, Debug, PartialEq, Eq)]
+pub struct GitReceivePackArgs {
+ #[arg(long)]
+ pub http_backend_info_refs: bool,
+ pub directory: String,
+}
+
impl FromStr for ShackleCommand {
type Err = clap::error::Error;