Skip to content

Commit

Permalink
transport-helper: don't feed bogus refs to export push
Browse files Browse the repository at this point in the history
When we want to push to a remote helper that has the
"export" capability, we collect all of the refs we want to
push and then feed them to fast-export.

However, the list of refs is actually a list of remote refs,
not local refs. The mapped local refs are included via the
peer_ref pointer. So when we add an argument to our
fast-export command line, we must be sure to use the local
peer_ref name (and if there is no local name, it is because
we are not actually sending that ref, or we may not even
have the ref at all).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Jul 19, 2011
1 parent 4e51ba2 commit 3ea7d09
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion t/t5800-remote-helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ test_expect_failure 'fetch multiple branches' '
compare_refs server new localclone refs/remotes/origin/new
'

test_expect_failure 'push when remote has extra refs' '
test_expect_success 'push when remote has extra refs' '
(cd clone &&
echo content >>file &&
git commit -a -m six &&
Expand Down
3 changes: 2 additions & 1 deletion transport-helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,8 @@ static int push_refs_with_export(struct transport *transport,
}
free(private);

string_list_append(&revlist_args, ref->name);
if (ref->peer_ref)
string_list_append(&revlist_args, ref->peer_ref->name);

}

Expand Down

0 comments on commit 3ea7d09

Please sign in to comment.