@@ -1877,24 +1877,6 @@ ClassMethod RunGitCommandWithInput(command As %String, inFile As %String = "", O
1877
1877
1878
1878
set newArgs ($increment (newArgs )) = command
1879
1879
1880
- /*
1881
- if ((..GitRemoteType() = "HTTPS") && ((command = "pull") || (command = "push") || (command = "fetch"))) {
1882
- set token = ##class(SourceControl.Git.Util.CredentialManager).GetToken($username, .err, .code)
1883
- if ((token = "") || (token = "key does not exist")) {
1884
- set errStream = ##class(%Stream.FileCharacter).%New()
1885
- do errStream.Write("Error: Please authenticate your https connection before attempting to use git")
1886
- set errStream.RemoveOnClose = 1
1887
- return 128
1888
- }
1889
- // Need to use token
1890
- set remote = ..GetConfiguredRemote()
1891
- set tokenURL = ##class(SourceControl.Git.OAuth2).SetRemoteURLWithToken(remote)
1892
- if (remote '= tokenURL) {
1893
- do ..SetConfiguredRemote(tokenURL)
1894
- }
1895
- }
1896
- */
1897
-
1898
1880
set syncIrisWithDiff = 0 // whether IRIS needs to be synced with repo file changes using diff output
1899
1881
set syncIrisWithCommand = 0 // // whether IRIS needs to be synced with repo file changes using command output
1900
1882
set diffBase = " "
@@ -2023,17 +2005,18 @@ ClassMethod RunGitCommandWithInput(command As %String, inFile As %String = "", O
2023
2005
2024
2006
if ((..GitRemoteType () = " HTTPS" ) && ((command = " pull" ) || (command = " push" ) || (command = " fetch" ))) {
2025
2007
set token = ##class (SourceControl.Git.OAuth2 ).GetToken ()
2026
- if $$$isWINDOWS {
2027
- set env (" GIT_ASKPASS" ) = " " " cmd /c " _token _" " " ;"
2028
- } else {
2029
- set env (" GIT_ASKPASS" ) = " sh -c " " echo " _token _" " " "
2008
+ if (token ) {
2009
+ if ($$$isWINDOWS) {
2010
+ set env (" GIT_ASKPASS" ) = " " " cmd /c " _token _" " " ;"
2011
+ } else {
2012
+ set env (" GIT_ASKPASS" ) = " sh -c " " echo " _token _" " " "
2013
+ }
2030
2014
}
2031
2015
}
2032
2016
try {
2033
2017
// Inject instance manager directory as global git config home directory
2034
2018
// On Linux, this avoids trying to use /root/.config/git/attributes for global git config
2035
2019
set env (" XDG_CONFIG_HOME" ) = ##class (%File ).ManagerDirectory ()
2036
- set env (" GIT_ASKPASS" ) = " " " cmd /c " _token _" " " ;"
2037
2020
set returnCode = $zf (-100 ," /ENV=env... " _baseArgs ,gitCommand ,newArgs ...)
2038
2021
} catch e {
2039
2022
if $$$isWINDOWS {
0 commit comments