Fixed uncommited changes line not appearing on rebase with a single conflict (no other changes)
This commit is contained in:
parent
51ea75c033
commit
7f9da646ff
3 changed files with 23 additions and 4 deletions
|
@ -292,11 +292,13 @@ class StatusManager @Inject constructor(
|
||||||
val addedCount = changesGrouped[StatusType.ADDED].countOrZero()
|
val addedCount = changesGrouped[StatusType.ADDED].countOrZero()
|
||||||
|
|
||||||
val modifiedCount = changesGrouped[StatusType.MODIFIED].countOrZero()
|
val modifiedCount = changesGrouped[StatusType.MODIFIED].countOrZero()
|
||||||
|
val conflictingCount = changesGrouped[StatusType.CONFLICTING].countOrZero()
|
||||||
|
|
||||||
return StatusSummary(
|
return StatusSummary(
|
||||||
modifiedCount = modifiedCount,
|
modifiedCount = modifiedCount,
|
||||||
deletedCount = deletedCount,
|
deletedCount = deletedCount,
|
||||||
addedCount = addedCount,
|
addedCount = addedCount,
|
||||||
|
conflictingCount = conflictingCount,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -338,4 +340,14 @@ enum class StatusType {
|
||||||
CONFLICTING,
|
CONFLICTING,
|
||||||
}
|
}
|
||||||
|
|
||||||
data class StatusSummary(val modifiedCount: Int, val deletedCount: Int, val addedCount: Int)
|
data class StatusSummary(
|
||||||
|
val modifiedCount: Int,
|
||||||
|
val deletedCount: Int,
|
||||||
|
val addedCount: Int,
|
||||||
|
val conflictingCount: Int,
|
||||||
|
) {
|
||||||
|
val total = modifiedCount +
|
||||||
|
deletedCount +
|
||||||
|
addedCount +
|
||||||
|
conflictingCount
|
||||||
|
}
|
|
@ -590,6 +590,14 @@ fun LogStatusSummary(statusSummary: StatusSummary, modifier: Modifier) {
|
||||||
color = MaterialTheme.colors.deleteFile,
|
color = MaterialTheme.colors.deleteFile,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (statusSummary.conflictingCount > 0) {
|
||||||
|
SummaryEntry(
|
||||||
|
count = statusSummary.conflictingCount,
|
||||||
|
icon = Icons.Default.Warning,
|
||||||
|
color = MaterialTheme.colors.conflictFile,
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -58,8 +58,7 @@ class LogViewModel @Inject constructor(
|
||||||
git = git,
|
git = git,
|
||||||
)
|
)
|
||||||
|
|
||||||
val hasUncommitedChanges =
|
val hasUncommitedChanges = statusSummary.total > 0
|
||||||
statusSummary.addedCount + statusSummary.deletedCount + statusSummary.modifiedCount > 0
|
|
||||||
val log = logManager.loadLog(git, currentBranch, hasUncommitedChanges)
|
val log = logManager.loadLog(git, currentBranch, hasUncommitedChanges)
|
||||||
|
|
||||||
_logStatus.value = LogStatus.Loaded(hasUncommitedChanges, log, currentBranch, statusSummary)
|
_logStatus.value = LogStatus.Loaded(hasUncommitedChanges, log, currentBranch, statusSummary)
|
||||||
|
@ -162,7 +161,7 @@ class LogViewModel @Inject constructor(
|
||||||
git = git,
|
git = git,
|
||||||
)
|
)
|
||||||
} else
|
} else
|
||||||
StatusSummary(0, 0, 0)
|
StatusSummary(0, 0, 0, 0)
|
||||||
|
|
||||||
val previousLogStatusValue = _logStatus.value
|
val previousLogStatusValue = _logStatus.value
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue