File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
core/src/main/kotlin/cc/unitmesh/devti/observer/agent Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -32,8 +32,6 @@ import com.intellij.vcsUtil.VcsUtil
32
32
import org.jetbrains.annotations.NonNls
33
33
import java.io.File
34
34
import java.io.IOException
35
- import java.nio.file.Path
36
- import java.util.*
37
35
38
36
@Service(Service .Level .PROJECT )
39
37
class AgentStateService (val project : Project ) {
@@ -53,10 +51,12 @@ class AgentStateService(val project: Project) {
53
51
54
52
fun addToChange (patch : TextFilePatch ) {
55
53
val baseDir = File (project.basePath!! )
56
- val newChangePath = getAbsolutePath(baseDir, patch.afterName).canonicalPath
57
- state.changes.removeIf {
58
- val afterRevision = it.afterRevision
59
- afterRevision != null && File (afterRevision.file.path).canonicalPath == newChangePath
54
+ if (patch.afterName != null ) {
55
+ val newChangePath = getAbsolutePath(baseDir, patch.afterName).canonicalPath
56
+ state.changes.removeIf {
57
+ val afterRevision = it.afterRevision
58
+ afterRevision != null && File (afterRevision.file.path).canonicalPath == newChangePath
59
+ }
60
60
}
61
61
62
62
val change = createChange(patch)
You can’t perform that action at this time.
0 commit comments