Skip to content

Commit

Permalink
Fixed rebase interactive taking the wrong message
Browse files Browse the repository at this point in the history
Fixes #165
  • Loading branch information
JetpackDuba committed Jun 14, 2024
1 parent d40a027 commit 59de2f3
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,17 @@ class StatusViewModel @Inject constructor(

private fun messageByRepoState(git: Git): String {
val message: String? =
if (
if (git.repository.repositoryState.isRebasing) {
val rebaseMergeDir = File(git.repository.directory, "rebase-merge")
val messageFile = File(rebaseMergeDir, "message")

if (messageFile.exists()) {
runCatching { messageFile.readText() }.getOrNull() ?: ""
} else {
""
}
} else if (
git.repository.repositoryState.isMerging ||
git.repository.repositoryState.isRebasing ||
git.repository.repositoryState.isReverting ||
git.repository.repositoryState.isCherryPicking
) {
Expand Down

0 comments on commit 59de2f3

Please sign in to comment.