@@ -90,7 +90,7 @@ public static Result Init(Enlistment enlistment)
9090
9191 public static Result SparseCheckoutInit ( Enlistment enlistment )
9292 {
93- return new GitProcess ( enlistment ) . InvokeGitInWorkingDirectoryRoot ( "sparse-checkout init --cone" , useReadObjectHook : false ) ;
93+ return new GitProcess ( enlistment ) . InvokeGitInWorkingDirectoryRoot ( "sparse-checkout init --cone" , fetchMissingObjects : false ) ;
9494 }
9595
9696 public static ConfigResult GetFromGlobalConfig ( string gitBinPath , string settingName )
@@ -413,19 +413,19 @@ public Result CreateBranchWithUpstream(string branchToCreate, string upstreamBra
413413
414414 public Result ForceCheckout ( string target )
415415 {
416- return this . InvokeGitInWorkingDirectoryRoot ( "checkout -f " + target , useReadObjectHook : true ) ;
416+ return this . InvokeGitInWorkingDirectoryRoot ( "checkout -f " + target , fetchMissingObjects : true ) ;
417417 }
418418
419419 public Result ForceCheckoutAllFiles ( )
420420 {
421- return this . InvokeGitInWorkingDirectoryRoot ( "checkout HEAD -- ." , useReadObjectHook : true ) ;
421+ return this . InvokeGitInWorkingDirectoryRoot ( "checkout HEAD -- ." , fetchMissingObjects : true ) ;
422422 }
423423
424424 public Result SparseCheckoutSet ( List < string > foldersToSet )
425425 {
426426 return this . InvokeGitInWorkingDirectoryRoot (
427427 $ "sparse-checkout set --stdin",
428- useReadObjectHook : true ,
428+ fetchMissingObjects : true ,
429429 writeStdIn : writer =>
430430 {
431431 foreach ( string path in foldersToSet )
@@ -449,7 +449,7 @@ public Result Status(bool allowObjectDownloads, bool useStatusCache, bool showUn
449449 command += " -uall" ;
450450 }
451451
452- return this . InvokeGitInWorkingDirectoryRoot ( command , useReadObjectHook : allowObjectDownloads ) ;
452+ return this . InvokeGitInWorkingDirectoryRoot ( command , fetchMissingObjects : allowObjectDownloads ) ;
453453 }
454454
455455 public Result UnpackObjects ( Stream packFileStream )
@@ -490,7 +490,7 @@ public Result WriteCommitGraph(string objectDir, List<string> packs)
490490 string command = "commit-graph write --stdin-packs --split --size-multiple=4 --object-dir \" " + objectDir + "\" " ;
491491 return this . InvokeGitInWorkingDirectoryRoot (
492492 command ,
493- useReadObjectHook : true ,
493+ fetchMissingObjects : true ,
494494 writeStdIn : writer =>
495495 {
496496 foreach ( string packIndex in packs )
@@ -506,7 +506,7 @@ public Result WriteCommitGraph(string objectDir, List<string> packs)
506506 public Result VerifyCommitGraph ( string objectDir )
507507 {
508508 string command = "commit-graph verify --shallow --object-dir \" " + objectDir + "\" " ;
509- return this . InvokeGitInWorkingDirectoryRoot ( command , useReadObjectHook : true ) ;
509+ return this . InvokeGitInWorkingDirectoryRoot ( command , fetchMissingObjects : true ) ;
510510 }
511511
512512 public Result IndexPack ( string packfilePath , string idxOutputPath )
@@ -547,7 +547,7 @@ public Result LsFiles(Action<string> parseStdOutLine)
547547 {
548548 return this . InvokeGitInWorkingDirectoryRoot (
549549 "ls-files -v" ,
550- useReadObjectHook : false ,
550+ fetchMissingObjects : false ,
551551 parseStdOutLine : parseStdOutLine ) ;
552552 }
553553
@@ -588,7 +588,7 @@ public Result MultiPackIndexRepack(string gitObjectDirectory, string batchSize)
588588 return this . InvokeGitAgainstDotGitFolder ( $ "-c pack.threads=1 multi-pack-index repack --object-dir=\" { gitObjectDirectory } \" --batch-size={ batchSize } ") ;
589589 }
590590
591- public Process GetGitProcess ( string command , string workingDirectory , string dotGitDirectory , bool useReadObjectHook , bool redirectStandardError , string gitObjectsDirectory )
591+ public Process GetGitProcess ( string command , string workingDirectory , string dotGitDirectory , bool fetchMissingObjects , bool redirectStandardError , string gitObjectsDirectory )
592592 {
593593 ProcessStartInfo processInfo = new ProcessStartInfo ( this . gitBinPath ) ;
594594 processInfo . WorkingDirectory = workingDirectory ;
@@ -632,9 +632,9 @@ public Process GetGitProcess(string command, string workingDirectory, string dot
632632 processInfo . EnvironmentVariables [ "GIT_OBJECT_DIRECTORY" ] = gitObjectsDirectory ;
633633 }
634634
635- if ( ! useReadObjectHook )
635+ if ( ! fetchMissingObjects )
636636 {
637- command = "-c " + GitConfigSetting . CoreVirtualizeObjectsName + " =false " + command ;
637+ command = $ "-c { ScalarConstants . GitConfig . UseGvfsHelper } =false { command } " ;
638638 }
639639
640640 if ( ! string . IsNullOrEmpty ( dotGitDirectory ) )
@@ -654,7 +654,7 @@ protected virtual Result InvokeGitImpl(
654654 string command ,
655655 string workingDirectory ,
656656 string dotGitDirectory ,
657- bool useReadObjectHook ,
657+ bool fetchMissingObjects ,
658658 Action < StreamWriter > writeStdIn ,
659659 Action < string > parseStdOutLine ,
660660 int timeoutMs ,
@@ -670,7 +670,13 @@ protected virtual Result InvokeGitImpl(
670670 // From https://msdn.microsoft.com/en-us/library/system.diagnostics.process.standardoutput.aspx
671671 // To avoid deadlocks, use asynchronous read operations on at least one of the streams.
672672 // Do not perform a synchronous read to the end of both redirected streams.
673- using ( this . executingProcess = this . GetGitProcess ( command , workingDirectory , dotGitDirectory , useReadObjectHook , redirectStandardError : true , gitObjectsDirectory : gitObjectsDirectory ) )
673+ using ( this . executingProcess = this . GetGitProcess (
674+ command ,
675+ workingDirectory ,
676+ dotGitDirectory ,
677+ fetchMissingObjects : fetchMissingObjects ,
678+ redirectStandardError : true ,
679+ gitObjectsDirectory : gitObjectsDirectory ) )
674680 {
675681 StringBuilder output = new StringBuilder ( ) ;
676682 StringBuilder errors = new StringBuilder ( ) ;
@@ -793,7 +799,7 @@ private Result InvokeGitOutsideEnlistment(
793799 command ,
794800 workingDirectory : Environment . SystemDirectory ,
795801 dotGitDirectory : null ,
796- useReadObjectHook : false ,
802+ fetchMissingObjects : false ,
797803 writeStdIn : writeStdIn ,
798804 parseStdOutLine : parseStdOutLine ,
799805 timeoutMs : timeout ) ;
@@ -804,15 +810,15 @@ private Result InvokeGitOutsideEnlistment(
804810 /// </summary>
805811 private Result InvokeGitInWorkingDirectoryRoot (
806812 string command ,
807- bool useReadObjectHook ,
813+ bool fetchMissingObjects ,
808814 Action < StreamWriter > writeStdIn = null ,
809815 Action < string > parseStdOutLine = null )
810816 {
811817 return this . InvokeGitImpl (
812818 command ,
813819 workingDirectory : this . workingDirectoryRoot ,
814820 dotGitDirectory : null ,
815- useReadObjectHook : useReadObjectHook ,
821+ fetchMissingObjects : fetchMissingObjects ,
816822 writeStdIn : writeStdIn ,
817823 parseStdOutLine : parseStdOutLine ,
818824 timeoutMs : - 1 ) ;
@@ -840,7 +846,7 @@ private Result InvokeGitAgainstDotGitFolder(
840846 command ,
841847 workingDirectory : Environment . SystemDirectory ,
842848 dotGitDirectory : this . dotGitRoot ,
843- useReadObjectHook : false ,
849+ fetchMissingObjects : false ,
844850 writeStdIn : writeStdIn ,
845851 parseStdOutLine : parseStdOutLine ,
846852 timeoutMs : - 1 ,
0 commit comments