Skip to content

Commit e083ef5

Browse files
chooglengitster
authored andcommitted
t5516: add test case for pushing remote refspecs
"git push remote-name" (that is, with no refspec given on the command line) should push the refspecs in remote.remote-name.push. There is no test case that checks this behavior in detached HEAD, so add one. Signed-off-by: Glen Choo <[email protected]> Reviewed-by: Jonathan Tan <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2bd2f25 commit e083ef5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

t/t5516-fetch-push.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,15 @@ do
541541

542542
done
543543

544+
test_expect_success "push to remote with no explicit refspec and config remote.*.push = src:dest" '
545+
mk_test testrepo heads/main &&
546+
git checkout $the_first_commit &&
547+
test_config remote.there.url testrepo &&
548+
test_config remote.there.push refs/heads/main:refs/heads/main &&
549+
git push there &&
550+
check_push_result testrepo $the_commit heads/main
551+
'
552+
544553
test_expect_success 'push with remote.pushdefault' '
545554
mk_test up_repo heads/main &&
546555
mk_test down_repo heads/main &&

0 commit comments

Comments
 (0)