on master help sign in
shallow clone
a229f40Skyler Hawthorne
helix-loader/src/grammar.rs+5−2
@@ -129,7 +129,7 @@ where
129 // TODO: print all failures instead of the first one found.
129 // TODO: print all failures instead of the first one found.
130 rx.iter()
130 rx.iter()
131 .find(|result| result.is_err())
131 .find(|result| result.is_err())
132− .map(|err| err.with_context(|| format!("Failed to {} some grammar(s)", action)))
132+ .map(|err| err.with_context(|| format!("Failed to {action} some grammar(s)")))
133 .unwrap_or(Ok(()))
133 .unwrap_or(Ok(()))
134}
134}
135
135
@@ -162,7 +162,10 @@ fn fetch_grammar(grammar: GrammarConfiguration) -> Result<()> {
162 // Fetch the exact revision from the remote.
162 // Fetch the exact revision from the remote.
163 // Supported by server-side git since v2.5.0 (July 2015),
163 // Supported by server-side git since v2.5.0 (July 2015),
164 // enabled by default on major git hosts.
164 // enabled by default on major git hosts.
165+ git(
166+ &grammar_dir,
165− git(&grammar_dir, ["fetch", REMOTE_NAME, &revision])?;
167+ ["fetch", "--depth", "1", REMOTE_NAME, &revision],
168+ )?;
166 git(&grammar_dir, ["checkout", &revision])?;
169 git(&grammar_dir, ["checkout", &revision])?;
167
170
168 println!(
171 println!(