This repository was archived by the owner on Dec 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 405
Conversation
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
…e in case the local branch is named differently from upstream
smashwilson
approved these changes
Sep 27, 2018
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
annthurium
approved these changes
Sep 27, 2018
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work! Thanks for taking this on.
.instance() | ||
.pull(await wrapper.instance().fetchData(repository))(); | ||
const postPullSHA = await repository.git.exec(['rev-parse', 'HEAD']); | ||
assert.isTrue(repository.pull.called); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: do you want to assert that repository.pull
was called with the args you expect?
.instance() | ||
.push(await wrapper.instance().fetchData(repository))(); | ||
const remoteSHA = await repository.git.exec(['rev-parse', 'origin/master']); | ||
assert.isTrue(repository.push.called); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same nit as above - might be good to specify which args push
should be called with.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description of the Change
This PR introduces the use of
refspec
in push and pull operations (fetch does it a bit differently), in order to handle situations where the local branch is named differently from its tracking branch. This set of circumstances has become less of an edge case since the introduction of PR-checkout -- we prefix the branch name with PR number, etc.Benefits
Possible Drawbacks
This PR changes how the underlying git operations work, which is used by many things in the package; so the possible setback is if things break in edge cases that I haven't thought of.
Applicable Issues
fixes: #1697
fixes: #918
Metrics
N/A
Tests
Added unit tests to verify that push & pull & fetch work as expected despite the difference between local branch name and its upstream branch name.
Manually tested push & pull & fetch operations in these cases: