Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UpstreamBranch is assuming the value returned by `git rev-parse` match '<remote name>/<branch name>' and split the string on the first / to retrieve the remote branch name. That only works when the remote name does not have slashes in its name, otherwise the returned branch name is invalid and not pointing to a git valid object: - If the remote is 'origin', the rev-parse returned value would be like 'origin/branch/name' and UpstreamBranch would return 'branch/name'. - But if the remote is 'gitlab/origin', the rev-parse returned value would be like 'gitlab/origin/branch/name' and UpstreamBranch would return 'origin/branch/name'. `git rev-parse --abbrev-ref @{upstream}` constructs its value by appending branch.<name>.remote and branch.<name>.merge (and removing 'refs/heads/' from the merge part) according to its man page. What we really want here is branch.<name>.merge (without 'refs/heads/'), not @{upstream}. This patch is implementing this. Signed-off-by: Antoine Tenart <atenart@kernel.org>
- Loading branch information