Skip to content

Commit

Permalink
"git-push $URL" without refspecs pushes only matching branches
Browse files Browse the repository at this point in the history
When "git push" is run without any refspec (neither on the
command line nor in the config), we used to push "matching refs"
in the sense that anything under refs/ hierarchy that exist on
both ends were updated.  This used to be a sane default for
publishing your repository to another back when we did not have
refs/remotes/ hierarchy, but it does not make much sense these
days.

This changes the semantics to push only "matching branches".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
gitster committed Jul 3, 2007
1 parent b941ffa commit 098e711
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions remote.c
Expand Up @@ -544,6 +544,13 @@ int match_refs(struct ref *src, struct ref *dst, struct ref ***dst_tail,
if (!pat)
continue;
}
else if (prefixcmp(src->name, "refs/heads/"))
/*
* "matching refs"; traditionally we pushed everything
* including refs outside refs/heads/ hierarchy, but
* that does not make much sense these days.
*/
continue;

if (pat) {
const char *dst_side = pat->dst ? pat->dst : pat->src;
Expand Down

0 comments on commit 098e711

Please sign in to comment.