[gitlab] Fix refspec for fetching special refs for private forks (IDEA-350198)

Known issue: special refs are currently not visible in log unless checked out.

GitOrigin-RevId: 3355b5b137eb914fd3f25a5896d357fea1a58904
This commit is contained in:
Chris Lemaire
2024-03-28 17:27:37 +00:00
committed by intellij-monorepo-bot
parent dae16b1ef2
commit 9f3822e4e3
@@ -129,7 +129,11 @@ object GitRemoteBranchesUtil {
withRawProgressReporter {
withContext(Dispatchers.Default) {
coroutineToIndicator {
GitFetchSupport.fetchSupport(repository.project).fetch(repository, branch.remote, branch.nameForRemoteOperations)
val refspec = when (branch) {
is GitSpecialRefRemoteBranch -> "${branch.nameForRemoteOperations}:${branch.nameForLocalOperations}"
else -> branch.nameForRemoteOperations
}
GitFetchSupport.fetchSupport(repository.project).fetch(repository, branch.remote, refspec)
}
}
}