diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-11-12 22:26:24 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-11-12 22:26:24 -0800 |
commit | 3fdd37fe1520765d1d207737ab65415e3d2ca174 (patch) | |
tree | 7b3372412421ba23026a0b902b14a23dea79496a /remote.c | |
parent | ecbbfb15a42987deb6620c4575c420002313af23 (diff) | |
parent | 18afe101eb2c2f68ba58085515f592148128fba3 (diff) | |
download | git-3fdd37fe1520765d1d207737ab65415e3d2ca174.tar.gz |
Merge branch 'mk/maint-cg-push'
* mk/maint-cg-push:
git push: Interpret $GIT_DIR/branches in a Cogito compatible way
Conflicts:
t/t5516-fetch-push.sh
Diffstat (limited to 'remote.c')
-rw-r--r-- | remote.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -299,6 +299,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 */ } |