summaryrefslogtreecommitdiff
path: root/notes.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-03-30 23:07:12 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-04-05 20:35:57 (GMT)
commit135dadef712f0c4cf884940e751024c831937904 (patch)
tree84572dd70ab3621c74df5a172b332469c2c77c1a /notes.h
parentd365a432271d2f6384cda9c37fb2fe463bdc2850 (diff)
downloadgit-135dadef712f0c4cf884940e751024c831937904.zip
git-135dadef712f0c4cf884940e751024c831937904.tar.gz
git-135dadef712f0c4cf884940e751024c831937904.tar.bz2
push: error out when the "upstream" semantics does not make sense
The user can say "git push" without specifying any refspec. When using the "upstream" semantics via the push.default configuration, the user wants to update the "upstream" branch of the current branch, which is the branch at a remote repository the current branch is set to integrate with, with this command. However, there are cases that such a "git push" that uses the "upstream" semantics does not make sense: - The current branch does not have branch.$name.remote configured. By definition, "git push" that does not name where to push to will not know where to push to. The user may explicitly say "git push $there", but again, by definition, no branch at repository $there is set to integrate with the current branch in this case and we wouldn't know which remote branch to update. - The current branch does have branch.$name.remote configured, but it does not specify branch.$name.merge that names what branch at the remote this branch integrates with. "git push" knows where to push in this case (or the user may explicitly say "git push $remote" to tell us where to push), but we do not know which remote branch to update. - The current branch does have its remote and upstream branch configured, but the user said "git push $there", where $there is not the remote named by "branch.$name.remote". By definition, no branch at repository $there is set to integrate with the current branch in this case, and this push is not meant to update any branch at the remote repository $there. The first two cases were already checked correctly, but the third case was not checked and we ended up updating the branch named branch.$name.merge at repository $there, which was totally bogus. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'notes.h')
0 files changed, 0 insertions, 0 deletions