From 9f3822e4e3aea71e1d39e5d78d30d8a451680048 Mon Sep 17 00:00:00 2001 From: Chris Lemaire Date: Wed, 27 Mar 2024 16:59:12 +0100 Subject: [PATCH] [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 --- .../src/git4idea/remote/hosting/GitRemoteBranchesUtil.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/git4idea/src/git4idea/remote/hosting/GitRemoteBranchesUtil.kt b/plugins/git4idea/src/git4idea/remote/hosting/GitRemoteBranchesUtil.kt index 05717d555e1c..d7bfa602b7bc 100644 --- a/plugins/git4idea/src/git4idea/remote/hosting/GitRemoteBranchesUtil.kt +++ b/plugins/git4idea/src/git4idea/remote/hosting/GitRemoteBranchesUtil.kt @@ -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) } } }