From d9eeddfad156a8b10fa6877c4fbca4dd19d0a3fa Mon Sep 17 00:00:00 2001 From: Andre Hartmann Date: Thu, 8 Feb 2024 14:40:24 +0100 Subject: [PATCH] Git: Fix upstream status for untracked branches Using HEAD is wrong as soon as the branch is not checked out. Instead the branch name must be used. Amends 960ac1adf4855ce73d36c265a6b08da0e478bd93 Change-Id: Id10b4012455ccb9b393404413a369f241edc098e Reviewed-by: Reviewed-by: Orgad Shaneh --- src/plugins/git/branchmodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/git/branchmodel.cpp b/src/plugins/git/branchmodel.cpp index fa9dee2cb37..14a59f0993b 100644 --- a/src/plugins/git/branchmodel.cpp +++ b/src/plugins/git/branchmodel.cpp @@ -914,7 +914,7 @@ void BranchModel::updateUpstreamStatus(BranchNode *node) process->setEnvironment(gitClient().processEnvironment()); QStringList parameters = {"rev-list", "--no-color", "--count"}; if (node->tracking.isEmpty()) - parameters += {"HEAD", "--not", "--remotes"}; + parameters += {node->fullRef(), "--not", "--remotes"}; else parameters += {"--left-right", node->fullRef() + "..." + node->tracking}; process->setCommand({gitClient().vcsBinary(), parameters});