File tree Expand file tree Collapse file tree
apps/sim/connectors/azure-devops Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -220,6 +220,7 @@ interface GitRepository {
220220 isDisabled ?: boolean
221221 remoteUrl ?: string
222222 webUrl ?: string
223+ size ?: number
223224}
224225
225226interface GitItem {
@@ -850,9 +851,23 @@ async function resolveRepoFiles(
850851 for ( const repo of repositories ) {
851852 const branch = filters . branch || stripRefsHeads ( repo . defaultBranch ?? '' )
852853 if ( ! branch ) {
854+ /**
855+ * No branch override and no resolvable default branch. An empty
856+ * repository (size 0) has nothing to list and nothing previously synced,
857+ * so it is skipped without flagging — flagging here would permanently
858+ * suppress deletion reconciliation for any project containing an empty
859+ * repo. A non-empty repository reaching this branch means content exists
860+ * but its default branch ref is missing/unreadable, so the listing is
861+ * flagged incomplete to protect previously synced files from
862+ * reconciliation deletion.
863+ */
864+ if ( ( repo . size ?? 0 ) > 0 && syncContext ) {
865+ syncContext . listingCapped = true
866+ }
853867 logger . warn ( 'Skipping Azure DevOps repository with no default branch' , {
854868 repoId : repo . id ,
855869 repoName : repo . name ,
870+ size : repo . size ?? 0 ,
856871 } )
857872 continue
858873 }
You can’t perform that action at this time.
0 commit comments