@@ -732,27 +732,6 @@ func TestGitRepositoryReconciler_reconcileSource_checkoutStrategy(t *testing.T)
732732 wantRevision : "staging@sha1:<commit>" ,
733733 wantReconciling : false ,
734734 },
735- {
736- name : "Optimized clone (legacy revision format)" ,
737- reference : & sourcev1.GitRepositoryRef {
738- Branch : "staging" ,
739- },
740- beforeFunc : func (obj * sourcev1.GitRepository , latestRev string ) {
741- // Add existing artifact on the object and storage.
742- obj .Status = sourcev1.GitRepositoryStatus {
743- Artifact : & sourcev1.Artifact {
744- Revision : "staging/" + latestRev ,
745- Path : randStringRunes (10 ),
746- },
747- }
748- conditions .MarkTrue (obj , sourcev1 .ArtifactInStorageCondition , meta .SucceededReason , "foo" )
749- conditions .MarkTrue (obj , meta .ReadyCondition , meta .SucceededReason , "foo" )
750- },
751- want : sreconcile .ResultEmpty ,
752- wantErr : true ,
753- wantRevision : "staging@sha1:<commit>" ,
754- wantReconciling : false ,
755- },
756735 {
757736 name : "Optimized clone different ignore" ,
758737 reference : & sourcev1.GitRepositoryRef {
@@ -775,28 +754,6 @@ func TestGitRepositoryReconciler_reconcileSource_checkoutStrategy(t *testing.T)
775754 wantRevision : "staging@sha1:<commit>" ,
776755 wantReconciling : false ,
777756 },
778- {
779- name : "Optimized clone different ignore (legacy revision format)" ,
780- reference : & sourcev1.GitRepositoryRef {
781- Branch : "staging" ,
782- },
783- beforeFunc : func (obj * sourcev1.GitRepository , latestRev string ) {
784- // Set new ignore value.
785- obj .Spec .Ignore = pointer .StringPtr ("foo" )
786- // Add existing artifact on the object and storage.
787- obj .Status = sourcev1.GitRepositoryStatus {
788- Artifact : & sourcev1.Artifact {
789- Revision : "staging/" + latestRev ,
790- Path : randStringRunes (10 ),
791- },
792- }
793- conditions .MarkTrue (obj , sourcev1 .ArtifactInStorageCondition , meta .SucceededReason , "foo" )
794- conditions .MarkTrue (obj , meta .ReadyCondition , meta .SucceededReason , "foo" )
795- },
796- want : sreconcile .ResultSuccess ,
797- wantRevision : "staging@sha1:<commit>" ,
798- wantReconciling : false ,
799- },
800757 }
801758
802759 server , err := gittestserver .NewTempGitServer ()
@@ -956,28 +913,6 @@ func TestGitRepositoryReconciler_reconcileArtifact(t *testing.T) {
956913 * conditions .TrueCondition (sourcev1 .ArtifactInStorageCondition , meta .SucceededReason , "stored artifact for revision 'main@sha1:b9b3feadba509cb9b22e968a5d27e96c2bc2ff91'" ),
957914 },
958915 },
959- {
960- name : "Up-to-date artifact with legacy revision format should not update status" ,
961- dir : "testdata/git/repository" ,
962- includes : artifactSet {& sourcev1.Artifact {Revision : "main@sha1:b9b3feadba509cb9b22e968a5d27e96c2bc2ff91" , Digest : "some-checksum" }},
963- beforeFunc : func (obj * sourcev1.GitRepository ) {
964- obj .Spec .Interval = metav1.Duration {Duration : interval }
965- obj .Spec .Include = []sourcev1.GitRepositoryInclude {
966- {GitRepositoryRef : meta.LocalObjectReference {Name : "foo" }},
967- }
968- obj .Status .Artifact = & sourcev1.Artifact {Revision : "main/b9b3feadba509cb9b22e968a5d27e96c2bc2ff91" }
969- obj .Status .IncludedArtifacts = []* sourcev1.Artifact {{Revision : "main/b9b3feadba509cb9b22e968a5d27e96c2bc2ff91" , Digest : "some-checksum" }}
970- obj .Status .ObservedInclude = obj .Spec .Include
971- },
972- afterFunc : func (t * WithT , obj * sourcev1.GitRepository ) {
973- t .Expect (obj .Status .URL ).To (BeEmpty ())
974- t .Expect (obj .Status .Artifact .Revision ).To (Equal ("main/b9b3feadba509cb9b22e968a5d27e96c2bc2ff91" ))
975- },
976- want : sreconcile .ResultSuccess ,
977- assertConditions : []metav1.Condition {
978- * conditions .TrueCondition (sourcev1 .ArtifactInStorageCondition , meta .SucceededReason , "stored artifact for revision 'main/b9b3feadba509cb9b22e968a5d27e96c2bc2ff91'" ),
979- },
980- },
981916 {
982917 name : "Spec ignore overwrite is taken into account" ,
983918 dir : "testdata/git/repository" ,
0 commit comments