-
-
Notifications
You must be signed in to change notification settings - Fork 574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get default fetch remote from configuration #2204
Get default fetch remote from configuration #2204
Conversation
9c06fa8
to
5f2ff11
Compare
5f2ff11
to
9ebdddd
Compare
@extrawurst This PR is now ready for review. It is hopefully a small step towards making the error message Once it is merged, GitUI should respect configured remote branches for fetching and pushing. We could then start implementing a fallback for when no remote branch is configured. I’m also thinking about creating a couple |
Awesome!! I am going to review it tomorrow ! |
does this fix #1093 now? |
lgtm. just one thing:
can you mark the places with |
if so, lets mark that in the changelog |
I’ll have a look tomorrow on the train! |
As far as I can tell, this fixes #1093. I’ve updated the changelog entry. This is how I prepared the repository before I tested the branch:
I was able to successfully pull in this setup. Since git automatically sets up |
This PR is in response to #1093. It changes how GitUI gets the remote to fetch from.
This is a follow-up PR to #2156 which added similar behaviour for pushing.
It changes the following:
get_default_remote_for_fetch_in_repo
which reads git configuration related to remote repositories. It first readsbranch.<name>.remote
. This is according to the docs.I followed the checklist:
make check
without errorsTest fetch/pull behavior in status tab:
If no upstream branch is configured, you still can’t fetch from a remote if you have renamed
origin
to something else, e. g.non-origin
. I think this is the right thing to do for the time being. As far as I’m aware, we want to provide a UI allowing users to choose a branch to fetch from in the future.man git-fetch
says: “When no remote is specified, by default the origin remote will be used, unless there’s an upstream branch configured for the current branch.”branch.<>.remote
is set