@@ -55,6 +55,7 @@ public DefaultPhysicalGitCheckout(
55
55
/// </summary>
56
56
private async Task InitGitWorkspaceIfNeededAsync (
57
57
string repositoryPath ,
58
+ GitWorkspaceDescriptor workspaceDescriptor ,
58
59
GitExecutionContext gitContext ,
59
60
CancellationToken cancellationToken )
60
61
{
@@ -91,6 +92,7 @@ private async Task InitGitWorkspaceIfNeededAsync(
91
92
"-C" ,
92
93
repositoryPath ,
93
94
"config" ,
95
+ "set" ,
94
96
"core.symlinks" ,
95
97
"true"
96
98
] ,
@@ -101,9 +103,51 @@ private async Task InitGitWorkspaceIfNeededAsync(
101
103
cancellationToken ) . ConfigureAwait ( false ) ;
102
104
if ( exitCode != 0 )
103
105
{
104
- throw new InvalidOperationException ( $ "'git -C ... config core.symlinks true' exited with non-zero exit code { exitCode } ") ;
106
+ throw new InvalidOperationException ( $ "'git -C ... config set core.symlinks true' exited with non-zero exit code { exitCode } ") ;
105
107
}
106
108
}
109
+
110
+ if ( workspaceDescriptor . LfsStoragePath != null )
111
+ {
112
+ exitCode = await _processExecutor . ExecuteAsync (
113
+ new ProcessSpecification
114
+ {
115
+ FilePath = gitContext . Git ,
116
+ Arguments =
117
+ [
118
+ "-C" ,
119
+ repositoryPath ,
120
+ "config" ,
121
+ "set" ,
122
+ "lfs.storage" ,
123
+ workspaceDescriptor . LfsStoragePath
124
+ ] ,
125
+ WorkingDirectory = repositoryPath ,
126
+ EnvironmentVariables = gitContext . GitEnvs ,
127
+ } ,
128
+ CaptureSpecification . Sanitized ,
129
+ cancellationToken ) . ConfigureAwait ( false ) ;
130
+ }
131
+ else
132
+ {
133
+ exitCode = await _processExecutor . ExecuteAsync (
134
+ new ProcessSpecification
135
+ {
136
+ FilePath = gitContext . Git ,
137
+ Arguments =
138
+ [
139
+ "-C" ,
140
+ repositoryPath ,
141
+ "config" ,
142
+ "unset" ,
143
+ "lfs.storage"
144
+ ] ,
145
+ WorkingDirectory = repositoryPath ,
146
+ EnvironmentVariables = gitContext . GitEnvs ,
147
+ } ,
148
+ CaptureSpecification . Sanitized ,
149
+ cancellationToken ) . ConfigureAwait ( false ) ;
150
+ }
107
151
}
108
152
109
153
/// <summary>
@@ -700,6 +744,7 @@ private async Task CheckoutTargetCommitAsync(
700
744
"-c" ,
701
745
"advice.detachedHead=false" ,
702
746
"checkout" ,
747
+ "--progress" ,
703
748
"-f" ,
704
749
resolvedReference . TargetCommit ,
705
750
] ,
@@ -731,6 +776,7 @@ await DetectGitLfsAndReconfigureIfNecessaryAsync(
731
776
"-c" ,
732
777
"advice.detachedHead=false" ,
733
778
"checkout" ,
779
+ "--progress" ,
734
780
"-f" ,
735
781
resolvedReference . TargetCommit ,
736
782
] ,
@@ -1223,6 +1269,7 @@ private async Task CheckoutSubmoduleAsync(
1223
1269
"-c" ,
1224
1270
"advice.detachedHead=false" ,
1225
1271
"checkout" ,
1272
+ "--progress" ,
1226
1273
"-f" ,
1227
1274
submoduleCommit ,
1228
1275
] ,
@@ -1504,7 +1551,7 @@ public async Task PrepareGitWorkspaceAsync(
1504
1551
} ;
1505
1552
1506
1553
// Initialize the Git repository if needed.
1507
- await InitGitWorkspaceIfNeededAsync ( repositoryPath , gitContext , cancellationToken ) . ConfigureAwait ( false ) ;
1554
+ await InitGitWorkspaceIfNeededAsync ( repositoryPath , descriptor , gitContext , cancellationToken ) . ConfigureAwait ( false ) ;
1508
1555
1509
1556
// Resolve tags and refs if needed.
1510
1557
var potentiallyResolvedReference = await AttemptResolveReferenceToCommitWithoutFetchAsync (
0 commit comments