git-push and $GIT_DIR/branches

From: Martin Koegler <hidden>
Date: 2016-06-15 22:45:37

I think, that the git-push behaviour is a bit unlogical in conjunction
with $GIT_DIR/branches.

If $GIT_DIR/branches/name1 contains "<repository>#name2":
- git-fetch name1
  will fetch refs/heads/name2 from <repository> and store it in refs/heads/name1
- git-push name1
  will push refs/heads/master to refs/heads/master in <repository>

I would expect, that git-push would somehow honour #name2. As far as I remember,
cg-push name1 would have pushed HEAD to refs/heads/name2 in <repository>.

In remote.c, function read_branches_file the following code
would implement a similar behaviour:
        strbuf_init(&push, 0);
        strbuf_addstr(&push, "HEAD");
        if (frag) {
                strbuf_addf(&push, ":refs/heads/%s", frag);
        } else
                strbuf_addstr(&push, ":refs/heads/master");
        add_push_refspec(remote, strbuf_detach(&push, 0));

Options about this?

mfg Martin Kögler
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help