History

[clone] First version of writing references, but…

…there really should be control over where to write them exactly

Sebastian Thiel committed 6 years ago

Commit 445be271 parent 354e63f10 files · +60 −4Browse files

Showing the changes to src (4 of 10 files). Show all

Unified · Split

4 files
  1. src/plumbing/lean/main.rs +2 −0
  2. src/plumbing/lean/options.rs +4 −0
  3. src/plumbing/pretty/main.rs +2 −0
  4. src/plumbing/pretty/options.rs +4 −0
src/plumbing/lean/main.rs+2−0
@@ -53,12 +53,14 @@ pub fn main() -> Result<()> { · 52 unmodified lines
5353 protocol,
5454 url,
5555 directory,
56+ write_refs,
5657 }) => {
5758 let (_handle, progress) = prepare(verbose, "pack-receive", core::pack::receive::PROGRESS_RANGE);
5859 core::pack::receive(
5960 protocol,
6061 &url,
6162 directory,
63+ write_refs,
6264 progress::DoOrDiscard::from(progress),
6365 core::pack::receive::Context {
6466 thread_limit,
src/plumbing/lean/options.rs+4−0
@@ -92,6 +92,10 @@ pub struct PackReceive { · 91 unmodified lines
9292 #[argh(option, short = 'p')]
9393 pub protocol: Option<core::Protocol>,
9494
95+ /// write references to the given directory as well, right next to the pack and index file.
96+ #[argh(switch, short = 'r')]
97+ pub write_refs: bool,
98+
9599 /// the URLs or path from which to receive the pack.
96100 ///
97101 /// See here for a list of supported URLs: https://www.git-scm.com/docs/git-clone#_git_urls
src/plumbing/pretty/main.rs+2−0
@@ -127,6 +127,7 @@ pub fn main() -> Result<()> { · 126 unmodified lines
127127 match cmd {
128128 Subcommands::PackReceive {
129129 protocol,
130+ write_refs,
130131 url,
131132 directory,
132133 } => prepare_and_run(
@@ -140,6 +141,7 @@ pub fn main() -> Result<()> { · 7 unmodified lines
140141 protocol,
141142 &url,
142143 directory,
144+ write_refs,
143145 git_features::progress::DoOrDiscard::from(progress),
144146 core::pack::receive::Context {
145147 thread_limit,
src/plumbing/pretty/options.rs+4−0
@@ -49,6 +49,10 @@ pub enum Subcommands { · 48 unmodified lines
4949 #[clap(long, short = "p")]
5050 protocol: Option<core::Protocol>,
5151
52+ /// Write references to the given directory as well, right next to the pack and index file.
53+ #[clap(long, short = "r")]
54+ write_refs: bool,
55+
5256 /// The URLs or path from which to receive the pack.
5357 ///
5458 /// See here for a list of supported URLs: https://www.git-scm.com/docs/git-clone#_git_urls