Skip to content

Commit ec3f033

Browse files
committed
fix crash when creating new file
1 parent bd7287b commit ec3f033

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

helix-vcs/src/git.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub struct Git;
1212

1313
impl DiffProvider for Git {
1414
fn get_file_head(&self, file: &Path) -> Option<Vec<u8>> {
15-
debug_assert!(file.is_file());
15+
debug_assert!(!file.exists() || file.is_file());
1616
debug_assert!(file.is_absolute());
1717

1818
// discover a repository, requires a directory so we call parent (should not fail but exit gracefully in that case)

0 commit comments

Comments
 (0)