aboutsummaryrefslogtreecommitdiff
path: root/remote.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-11-12 22:26:24 -0800
committerJunio C Hamano <gitster@pobox.com>2008-11-12 22:26:24 -0800
commit3fdd37fe1520765d1d207737ab65415e3d2ca174 (patch)
tree7b3372412421ba23026a0b902b14a23dea79496a /remote.c
parentecbbfb15a42987deb6620c4575c420002313af23 (diff)
parent18afe101eb2c2f68ba58085515f592148128fba3 (diff)
downloadgit-3fdd37fe1520765d1d207737ab65415e3d2ca174.tar.gz
git-3fdd37fe1520765d1d207737ab65415e3d2ca174.tar.xz
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.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/remote.c b/remote.c
index cbb3e484f..570e11286 100644
--- a/remote.c
+++ b/remote.c
@@ -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 */
}