Log is now updated if uncommited changes status changed
This commit is contained in:
parent
eef36cf53c
commit
cc2a7e180f
1 changed files with 12 additions and 3 deletions
|
@ -122,12 +122,21 @@ class GitManager @Inject constructor(
|
|||
fun loadLog() = managerScope.launch {
|
||||
coLoadLog()
|
||||
}
|
||||
private suspend fun coLoadLog(){
|
||||
|
||||
private suspend fun coLoadLog() {
|
||||
logManager.loadLog(safeGit)
|
||||
}
|
||||
|
||||
suspend fun loadStatus() {
|
||||
val hadUncommitedChanges = statusManager.hasUncommitedChanges.value
|
||||
|
||||
statusManager.loadStatus(safeGit)
|
||||
|
||||
val hasNowUncommitedChanges = statusManager.hasUncommitedChanges.value
|
||||
|
||||
// Update the log only if the uncommitedChanges status has changed
|
||||
if (hasNowUncommitedChanges != hadUncommitedChanges)
|
||||
coLoadLog()
|
||||
}
|
||||
|
||||
fun stage(diffEntry: DiffEntry) = managerScope.launch {
|
||||
|
@ -153,14 +162,14 @@ class GitManager @Inject constructor(
|
|||
fun pull() = managerScope.launch {
|
||||
safeProcessing {
|
||||
remoteOperationsManager.pull(safeGit)
|
||||
logManager.loadLog(safeGit)
|
||||
coLoadLog()
|
||||
}
|
||||
}
|
||||
|
||||
fun push() = managerScope.launch {
|
||||
safeProcessing {
|
||||
remoteOperationsManager.push(safeGit)
|
||||
logManager.loadLog(safeGit)
|
||||
coLoadLog()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue