Update local tracking refs when pushing

This also adds a --remote option to send-pack, which specifies the
configured remote being used. It is provided automatically by
git-push, and must match the url (which is still needed, since there
could be multiple urls).

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Daniel Barkalow
2007-05-15 22:50:19 -04:00
committed by Junio C Hamano
parent 5d46c9d41f
commit b516968ff6
2 changed files with 53 additions and 11 deletions

View File

@ -178,8 +178,13 @@ static int do_push(const char *repo)
if (!prefixcmp(dest, "http://") ||
!prefixcmp(dest, "https://"))
sender = "http-push";
else if (thin)
argv[dest_argc++] = "--thin";
else {
char *rem = xmalloc(strlen(remote->name) + 10);
sprintf(rem, "--remote=%s", remote->name);
argv[dest_argc++] = rem;
if (thin)
argv[dest_argc++] = "--thin";
}
argv[0] = sender;
argv[dest_argc++] = dest;
while (dest_refspec_nr--)