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