From 4bad3a941c6e9825d76062b6d9f763eb35446b46 Mon Sep 17 00:00:00 2001 From: Abdelilah El Aissaoui Date: Sat, 12 Nov 2022 21:42:23 +0100 Subject: [PATCH] Removed unnecessary check --- .../gitnuro/git/FileChangesWatcher.kt | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/git/FileChangesWatcher.kt b/src/main/kotlin/com/jetpackduba/gitnuro/git/FileChangesWatcher.kt index f5f8171..368f0be 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/git/FileChangesWatcher.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/git/FileChangesWatcher.kt @@ -56,17 +56,6 @@ class FileChangesWatcher @Inject constructor() { val dir = keys[key] ?: return@withContext - if (events.count() == 1) { - val fileChanged = events.first().context().toString() - val fullPathOfFileChanged = "$pathStr$systemSeparator.git$systemSeparator$fileChanged" - - // Ignore COMMIT_EDITMSG changes - if (isGitMessageFile(pathStr, fullPathOfFileChanged)) { - printLog(TAG, "Ignored changes in $fullPathOfFileChanged") - return@withContext - } - } - _changesNotifier.emit(false) // Check if new directories have been added to add them to the watchService @@ -97,10 +86,4 @@ class FileChangesWatcher @Inject constructor() { private fun isGitDir(dir: Path, pathStr: String): Boolean { return dir.startsWith("$pathStr$systemSeparator.git$systemSeparator") } - - private fun isGitMessageFile(repoPath: String, fullPathOfFileChanged: String): Boolean { - val gitDir = "$repoPath$systemSeparator.git$systemSeparator" - return fullPathOfFileChanged == "${gitDir}COMMIT_EDITMSG" || - fullPathOfFileChanged == "${gitDir}MERGE_MSG" - } } \ No newline at end of file