Skip to content

Commit d7572d8

Browse files
committed
fix: ensure vendored grammar is in a clean state
1 parent f2ba0f5 commit d7572d8

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

helix-loader/src/grammar.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,8 @@ fn fetch_grammar(grammar: GrammarConfiguration) -> Result<FetchStatus> {
293293

294294
// ensure the revision matches the configured revision
295295
if get_revision(&grammar_dir).as_ref() != Some(&revision) {
296+
git(&grammar_dir, ["reset", "--hard"])?;
297+
git(&grammar_dir, ["clean", "-fdx"])?;
296298
// Fetch the exact revision from the remote.
297299
// Supported by server-side git since v2.5.0 (July 2015),
298300
// enabled by default on major git hosts.

0 commit comments

Comments
 (0)