@@ -1737,7 +1737,11 @@ ClassMethod RunGitCommandWithInput(command As %String, inFile As %String = "", O
1737
1737
} elseif (command = " restore" ) {
1738
1738
// Leave diffCompare empty, this actually does the right thing.
1739
1739
set syncIrisWithDiff = 1
1740
- } elseif (command = " merge" ) || (command = " rebase" ) || (command = " pull" ) {
1740
+ } elseif (command = " pull" ) {
1741
+ set syncIrisWithDiff = 1
1742
+ // The current revision, prior to the pull, will be compared against
1743
+ set diffCompare = ..GetCurrentRevision ()
1744
+ } elseif (command = " merge" ) || (command = " rebase" ) {
1741
1745
set syncIrisWithCommand = 1
1742
1746
if $data (args ) && $data (args (args ),diffCompare ) {
1743
1747
// no-op
@@ -1801,7 +1805,10 @@ ClassMethod RunGitCommandWithInput(command As %String, inFile As %String = "", O
1801
1805
set syncIrisWithCommand = 0
1802
1806
}
1803
1807
1804
- if syncIrisWithDiff {
1808
+ // If performing a pull don't perform a diff until after the pull has occured.
1809
+ // This is to avoid a double fetch, as pull performs one for us and also to avoid a potential
1810
+ // race condition if the remote changes between now and the pull actually being performed.
1811
+ if syncIrisWithDiff && (command '= " pull" ) {
1805
1812
if diffBase = " " {
1806
1813
set diffBase = ..GetCurrentBranch ()
1807
1814
}
@@ -1832,6 +1839,13 @@ ClassMethod RunGitCommandWithInput(command As %String, inFile As %String = "", O
1832
1839
}
1833
1840
}
1834
1841
1842
+ // If performing a pull then do a diff now after the pull has occured.
1843
+ if syncIrisWithDiff && (command = " pull" ) {
1844
+ do ##class (SourceControl.Git.Utils ).RunGitCommandWithInput (" diff" ,,.errorStream ,.outputStream , diffCompare , " --name-status" )
1845
+ // Verbose output should not be required as pull already outputs a summary
1846
+ do ..ParseDiffStream (outputStream ,0 ,.files )
1847
+ }
1848
+
1835
1849
set errStream = ##class (%Stream.FileCharacter ).%OpenId (errLog ,,.sc )
1836
1850
set outStream = ##class (%Stream.FileCharacter ).%OpenId (outLog ,,.sc )
1837
1851
set outStream .TranslateTable =" UTF8"
0 commit comments