Fixed stage all when there are removed files
This commit is contained in:
parent
3cb7d25a33
commit
c5f7ddf266
@ -39,16 +39,11 @@ class StatusManager @Inject constructor(
|
||||
}
|
||||
|
||||
suspend fun stage(git: Git, statusEntry: StatusEntry) = withContext(Dispatchers.IO) {
|
||||
if (statusEntry.statusType == StatusType.REMOVED) {
|
||||
git.rm()
|
||||
.addFilepattern(statusEntry.filePath)
|
||||
.call()
|
||||
} else {
|
||||
git.add()
|
||||
.addFilepattern(statusEntry.filePath)
|
||||
.setUpdate(statusEntry.statusType == StatusType.REMOVED)
|
||||
.call()
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun stageHunk(git: Git, diffEntry: DiffEntry, hunk: Hunk) = withContext(Dispatchers.IO) {
|
||||
val repository = git.repository
|
||||
@ -238,6 +233,12 @@ class StatusManager @Inject constructor(
|
||||
git
|
||||
.add()
|
||||
.addFilepattern(".")
|
||||
.setUpdate(true) // Modified and deleted files
|
||||
.call()
|
||||
git
|
||||
.add()
|
||||
.addFilepattern(".")
|
||||
.setUpdate(false) // For newly added files
|
||||
.call()
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user