Skip to content

Commit deb0d06

Browse files
committed
Fix issues with git pull page: preview displays changes, and pull/merge syncs modifications
1 parent 2a8f6ed commit deb0d06

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

cls/SourceControl/Git/Utils.cls

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1779,6 +1779,7 @@ ClassMethod SyncIrisWithRepoThroughCommand(ByRef outStream) As %Status
17791779
set addedFiles = ""
17801780
set files = ""
17811781
do outStream.Rewind()
1782+
// future: a less fragile way to do this is by running "git log" to list files changed in previous commit
17821783
while (outStream.AtEnd = 0) {
17831784
set line = outStream.ReadLine()
17841785
set lineStart = $piece(line, " ", 2)
@@ -1796,6 +1797,13 @@ ClassMethod SyncIrisWithRepoThroughCommand(ByRef outStream) As %Status
17961797
} else {
17971798
set deletedFiles = deletedFiles_","_internalName
17981799
}
1800+
} elseif (line [ "|") {
1801+
set externalName = $zstrip($piece(line,"|",1),"<>W")
1802+
set modification = ##class(SourceControl.Git.Modification).%New()
1803+
set modification.changeType = "C"
1804+
set modification.internalName = ##class(SourceControl.Git.Utils).NameToInternalName(externalName,,0)
1805+
set modification.externalName = externalName
1806+
set files($i(files)) = modification
17991807
}
18001808
}
18011809

@@ -2536,4 +2544,3 @@ ClassMethod BaselineExport(pCommitMessage = "", pPushToRemote = "") As %Status
25362544
}
25372545

25382546
}
2539-

cls/_zpkg/isc/sc/git/Socket.cls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ ClassMethod Run()
1616
do ##class(SourceControl.Git.Utils).RunGitWithArgs(.errStream, .outStream, "fetch")
1717
kill errStream, outStream
1818
do ##class(SourceControl.Git.Utils).RunGitWithArgs(.errStream, .outStream, "log", "HEAD..origin", "--name-status")
19+
do ##class(SourceControl.Git.Utils).PrintStreams(errStream, outStream)
1920
} ElseIf %request.Get("method") = "pull" {
2021
Do ##class(SourceControl.Git.API).Pull()
2122
} ElseIf %request.Get("method") = "init" {
@@ -194,4 +195,3 @@ Method SendJSON(pObject As %DynamicAbstractObject)
194195
}
195196

196197
}
197-

0 commit comments

Comments
 (0)