diff options
author | Martin Koegler <mkoegler@auto.tuwien.ac.at> | 2008-11-10 22:47:11 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-11-11 15:26:40 -0800 |
commit | 18afe101eb2c2f68ba58085515f592148128fba3 (patch) | |
tree | fb267e9cb07125764ed3481a48194138d5f85f35 /remote.c | |
parent | 9db56f71b91153f4076a796c80c61f00edd8b700 (diff) | |
download | git-18afe101eb2c2f68ba58085515f592148128fba3.tar.gz git-18afe101eb2c2f68ba58085515f592148128fba3.tar.xz |
git push: Interpret $GIT_DIR/branches in a Cogito compatible way
Current git versions ignore everything after # (called <head> in the
following) when pushing. Older versions (before cf818348f1ab57),
interpret #<head> as part of the URL, which make git bail out.
As branches origin from Cogito, it is the best to correct this by using
the behaviour of cg-push, that is to push HEAD to remote refs/heads/<head>.
Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'remote.c')
-rw-r--r-- | remote.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -298,6 +298,17 @@ static void read_branches_file(struct remote *remote) } add_url_alias(remote, p); add_fetch_refspec(remote, strbuf_detach(&branch, 0)); + /* + * Cogito compatible push: push current HEAD to remote #branch + * (master if missing) + */ + strbuf_init(&branch, 0); + strbuf_addstr(&branch, "HEAD"); + if (frag) + strbuf_addf(&branch, ":refs/heads/%s", frag); + else + strbuf_addstr(&branch, ":refs/heads/master"); + add_push_refspec(remote, strbuf_detach(&branch, 0)); remote->fetch_tags = 1; /* always auto-follow */ } |