Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlen Choo <chooglen@google.com>2021-11-18 03:53:21 +0300
committerJunio C Hamano <gitster@pobox.com>2021-11-19 09:31:18 +0300
commite083ef5d54707a4bb855e8ac6f6ee0576a020349 (patch)
treea0dc7e859f52a838d5b0264755c6598eda2a957b /t/t5516-fetch-push.sh
parent2bd2f258f4195ac54293a3f45b86457c0bd5fc11 (diff)
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 <chooglen@google.com> Reviewed-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5516-fetch-push.sh')
-rwxr-xr-xt/t5516-fetch-push.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh
index 8212ca56dc..7831a38dde 100755
--- a/t/t5516-fetch-push.sh
+++ b/t/t5516-fetch-push.sh
@@ -541,6 +541,15 @@ do
done
+test_expect_success "push to remote with no explicit refspec and config remote.*.push = src:dest" '
+ mk_test testrepo heads/main &&
+ git checkout $the_first_commit &&
+ test_config remote.there.url testrepo &&
+ test_config remote.there.push refs/heads/main:refs/heads/main &&
+ git push there &&
+ check_push_result testrepo $the_commit heads/main
+'
+
test_expect_success 'push with remote.pushdefault' '
mk_test up_repo heads/main &&
mk_test down_repo heads/main &&