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
This commit is contained in:
11
remote.c
11
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 */
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user