From ec3f033ae9410b9aea2671a192d759684043aa09 Mon Sep 17 00:00:00 2001 From: pascalkuthe Date: Tue, 20 Sep 2022 20:44:25 +0200 Subject: [PATCH] fix crash when creating new file --- helix-vcs/src/git.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helix-vcs/src/git.rs b/helix-vcs/src/git.rs index 08121ad109cf..c1dd07197c1f 100644 --- a/helix-vcs/src/git.rs +++ b/helix-vcs/src/git.rs @@ -12,7 +12,7 @@ pub struct Git; impl DiffProvider for Git { fn get_file_head(&self, file: &Path) -> Option> { - debug_assert!(file.is_file()); + debug_assert!(!file.exists() || file.is_file()); debug_assert!(file.is_absolute()); // discover a repository, requires a directory so we call parent (should not fail but exit gracefully in that case)