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 960ac1adf4

Change-Id: Id10b4012455ccb9b393404413a369f241edc098e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Andre Hartmann
2024-02-08 14:40:24 +01:00
committed by André Hartmann
parent 3b5c377ce5
commit d9eeddfad1

View File

@@ -914,7 +914,7 @@ void BranchModel::updateUpstreamStatus(BranchNode *node)
process->setEnvironment(gitClient().processEnvironment()); process->setEnvironment(gitClient().processEnvironment());
QStringList parameters = {"rev-list", "--no-color", "--count"}; QStringList parameters = {"rev-list", "--no-color", "--count"};
if (node->tracking.isEmpty()) if (node->tracking.isEmpty())
parameters += {"HEAD", "--not", "--remotes"}; parameters += {node->fullRef(), "--not", "--remotes"};
else else
parameters += {"--left-right", node->fullRef() + "..." + node->tracking}; parameters += {"--left-right", node->fullRef() + "..." + node->tracking};
process->setCommand({gitClient().vcsBinary(), parameters}); process->setCommand({gitClient().vcsBinary(), parameters});