Removed unnecessary check
This commit is contained in:
parent
76e5237cd5
commit
4bad3a941c
@ -56,17 +56,6 @@ class FileChangesWatcher @Inject constructor() {
|
|||||||
|
|
||||||
val dir = keys[key] ?: return@withContext
|
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)
|
_changesNotifier.emit(false)
|
||||||
|
|
||||||
// Check if new directories have been added to add them to the watchService
|
// 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 {
|
private fun isGitDir(dir: Path, pathStr: String): Boolean {
|
||||||
return dir.startsWith("$pathStr$systemSeparator.git$systemSeparator")
|
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"
|
|
||||||
}
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user