Merged
Conversation
Collaborator
Contributor
Author
|
@prarit Sure, no problem, I'll rebase and update this PR. |
dd99f46 to
8a2be40
Compare
Codecov Report
@@ Coverage Diff @@
## master #568 +/- ##
==========================================
- Coverage 58.11% 58.07% -0.04%
==========================================
Files 64 64
Lines 4219 4215 -4
==========================================
- Hits 2452 2448 -4
+ Misses 1529 1528 -1
- Partials 238 239 +1
Continue to review full report at Codecov.
|
bmeneg
reviewed
Jan 22, 2021
bmeneg
requested changes
Jan 22, 2021
fmuellner
reviewed
Jan 22, 2021
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>
Signed-off-by: Antoine Tenart <atenart@kernel.org>
8a2be40 to
ee99ea6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi,
This PR fixes one error message in internal/git and the UpstreamBranch function which has a too strict expectation on the local remote names.
Thanks!