@@ -536,12 +536,7 @@ func (r *GitRepositoryReconciler) reconcileSource(ctx context.Context, sp *patch
536
536
// Persist the ArtifactSet.
537
537
* includes = * artifacts
538
538
539
- var optimizedClone bool
540
- if val , ok := r .features [features .OptimizedGitClones ]; ok && val {
541
- optimizedClone = true
542
- }
543
-
544
- c , err := r .gitCheckout (ctx , obj , authOpts , dir , optimizedClone )
539
+ c , err := r .gitCheckout (ctx , obj , authOpts , dir )
545
540
if err != nil {
546
541
return sreconcile .ResultEmpty , err
547
542
}
@@ -583,7 +578,7 @@ func (r *GitRepositoryReconciler) reconcileSource(ctx context.Context, sp *patch
583
578
584
579
// If we can't skip the reconciliation, checkout again without any
585
580
// optimization.
586
- c , err := r .gitCheckout (ctx , obj , authOpts , dir , false )
581
+ c , err := r .gitCheckout (ctx , obj , authOpts , dir )
587
582
if err != nil {
588
583
return sreconcile .ResultEmpty , err
589
584
}
@@ -782,8 +777,7 @@ func (r *GitRepositoryReconciler) reconcileInclude(ctx context.Context, sp *patc
782
777
// gitCheckout builds checkout options with the given configurations and
783
778
// performs a git checkout.
784
779
func (r * GitRepositoryReconciler ) gitCheckout (ctx context.Context ,
785
- obj * sourcev1.GitRepository , authOpts * git.AuthOptions , dir string ,
786
- optimized bool ) (* git.Commit , error ) {
780
+ obj * sourcev1.GitRepository , authOpts * git.AuthOptions , dir string ) (* git.Commit , error ) {
787
781
// Configure checkout strategy.
788
782
cloneOpts := repository.CloneConfig {
789
783
RecurseSubmodules : obj .Spec .RecurseSubmodules ,
@@ -800,7 +794,7 @@ func (r *GitRepositoryReconciler) gitCheckout(ctx context.Context,
800
794
// Only if the object has an existing artifact in storage, attempt to
801
795
// short-circuit clone operation. reconcileStorage has already verified
802
796
// that the artifact exists.
803
- if optimized && conditions .IsTrue (obj , sourcev1 .ArtifactInStorageCondition ) {
797
+ if conditions .IsTrue (obj , sourcev1 .ArtifactInStorageCondition ) {
804
798
if artifact := obj .GetArtifact (); artifact != nil {
805
799
cloneOpts .LastObservedCommit = artifact .Revision
806
800
}
0 commit comments