@@ -285,7 +285,7 @@ ClassMethod Revert(InternalName As %String) As %Status
285
285
set filename = ..FullExternalName (.InternalName )
286
286
do ..RunGitCommand (" checkout" , .errStream , .outStream , " --" , filename )
287
287
$$$QuitOnError(##class (SourceControl.Git.Change ).RemoveUncommitted (filename ,0 ,1 ))
288
- $$$QuitOnError(##class (SourceControl.Git.Change ).RefreshUncommitted (0 ,1 ))
288
+ $$$QuitOnError(##class (SourceControl.Git.Change ).RefreshUncommitted (0 ,1 ,, 1 ))
289
289
$$$QuitOnError(..ImportItem (InternalName ,1 ))
290
290
quit $$$OK
291
291
}
@@ -299,7 +299,7 @@ ClassMethod Commit(InternalName As %String, Message As %String = "example commit
299
299
do ..RunGitWithArgs (.errStream , .outStream , " commit" , " --author" , author , " -m" , Message , filename )
300
300
do ..PrintStreams (outStream , outStream )
301
301
$$$QuitOnError(##class (SourceControl.Git.Change ).RemoveUncommitted (filename ))
302
- $$$QuitOnError(##class (SourceControl.Git.Change ).RefreshUncommitted ())
302
+ $$$QuitOnError(##class (SourceControl.Git.Change ).RefreshUncommitted (,,, 1 ))
303
303
quit $$$OK
304
304
}
305
305
@@ -453,7 +453,7 @@ ClassMethod GenerateSSHKeyPair() As %Status
453
453
do ##class (%File ).CreateDirectoryChain (dir )
454
454
set outLog = ##class (%Library.File ).TempFilename ()
455
455
set errLog = ##class (%Library.File ).TempFilename ()
456
- do $zf (-100 ," /SHELL / STDOUT=" _$$$QUOTE(outLog )_" /STDERR=" _$$$QUOTE(errLog ),
456
+ do $zf (-100 ," /STDOUT=" _$$$QUOTE(outLog )_" /STDERR=" _$$$QUOTE(errLog ),
457
457
" ssh-keygen" ,
458
458
" -t" ," ed25519" ,
459
459
" -C" ,email ,
@@ -1485,8 +1485,20 @@ ClassMethod RunGitCommandWithInput(command As %String, inFile As %String = "", O
1485
1485
set errLog = ##class (%Library.File ).TempFilename ()
1486
1486
1487
1487
set command = $extract (..GitBinPath (),2 ,*-1 )
1488
- // Need /SHELL on Linux to avoid permissions errors trying to use root's config
1489
- set returnCode = $zf (-100 ," /SHELL /STDOUT=" _$$$QUOTE(outLog )_" /STDERR=" _$$$QUOTE(errLog )_$case (inFile , " " :" " , :" /STDIN=" _$$$QUOTE(inFile )),command ,newArgs ...)
1488
+ set baseArgs = " /STDOUT=" _$$$QUOTE(outLog )_" /STDERR=" _$$$QUOTE(errLog )_$case (inFile , " " :" " , :" /STDIN=" _$$$QUOTE(inFile ))
1489
+ try {
1490
+ // Inject instance manager directory as global git config home directory
1491
+ // On Linux, this avoids trying to use /root/.config/git/attributes for global git config
1492
+ set env (" XDG_CONFIG_HOME" ) = ##class (%File ).ManagerDirectory ()
1493
+ set returnCode = $zf (-100 ," /ENV=env... " _baseArgs ,command ,newArgs ...)
1494
+ } catch e {
1495
+ if $$$isWINDOWS {
1496
+ set returnCode = $zf (-100 ,baseArgs ,command ,newArgs ...)
1497
+ } else {
1498
+ // If can't inject XDG_CONFIG_HOME (older IRIS version), need /SHELL on Linux to avoid permissions errors trying to use root's config
1499
+ set returnCode = $zf (-100 ," /SHELL " _baseArgs ,command ,newArgs ...)
1500
+ }
1501
+ }
1490
1502
1491
1503
set errStream = ##class (%Stream.FileCharacter ).%OpenId (errLog ,,.sc )
1492
1504
set outStream = ##class (%Stream.FileCharacter ).%OpenId (outLog ,,.sc )
@@ -1999,3 +2011,4 @@ ClassMethod ResetSourceControlClass()
1999
2011
}
2000
2012
2001
2013
}
2014
+
0 commit comments