From 13684e4f90c07fa58b80db640e8992c0b5227e11 Mon Sep 17 00:00:00 2001 From: Abdelilah El Aissaoui Date: Wed, 2 Feb 2022 20:23:04 +0100 Subject: [PATCH] Fixed file delete not deleting the file using the repo path --- src/main/kotlin/app/viewmodels/StatusViewModel.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/app/viewmodels/StatusViewModel.kt b/src/main/kotlin/app/viewmodels/StatusViewModel.kt index 6311ea0..33ee53b 100644 --- a/src/main/kotlin/app/viewmodels/StatusViewModel.kt +++ b/src/main/kotlin/app/viewmodels/StatusViewModel.kt @@ -140,10 +140,10 @@ class StatusViewModel @Inject constructor( return@safeProcessing RefreshType.ALL_DATA } - fun deleteFile(diffEntry: DiffEntry) = tabState.runOperation { + fun deleteFile(diffEntry: DiffEntry) = tabState.runOperation { git -> val path = diffEntry.newPath - val fileToDelete = File(path) + val fileToDelete = File(git.repository.directory.parent, path) fileToDelete.delete()