From 2200ccd848b0ae509d1da1e4c95c4ac72822349b Mon Sep 17 00:00:00 2001 From: Christian Schilling Date: Mon, 29 Aug 2022 10:30:55 +0200 Subject: [PATCH] Change magic refs to include "for" This is a bit more consistent with the magic ref used by gerrit. Change-Id: magic-refs --- josh-proxy/src/lib.rs | 8 ++++---- tests/proxy/push_stacked.t | 18 +++++++++--------- tests/proxy/push_stacked_split.t | 4 ++-- tests/proxy/push_stacked_sub.t | 20 ++++++++++---------- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/josh-proxy/src/lib.rs b/josh-proxy/src/lib.rs index d6218f968..2b23fbd0d 100644 --- a/josh-proxy/src/lib.rs +++ b/josh-proxy/src/lib.rs @@ -33,13 +33,13 @@ fn baseref_and_options(refname: &str) -> josh::JoshResult<(String, String, Vec master) * Change-Id: 1234 * add file1 (origin/master, origin/HEAD) - $ git push -o author=foo@example.com origin master:refs/stack/master + $ git push -o author=foo@example.com origin master:refs/stack/for/master remote: josh-proxy remote: response from upstream: remote: To http://localhost:8001/real_repo.git @@ -37,8 +37,8 @@ remote: remote: To http://localhost:8002/real_repo.git - * [new reference] master -> refs/stack/master - $ git push -o author=josh@example.com origin master:refs/stack/master + * [new reference] master -> refs/stack/for/master + $ git push -o author=josh@example.com origin master:refs/stack/for/master remote: josh-proxy remote: response from upstream: remote: To http://localhost:8001/real_repo.git @@ -50,22 +50,22 @@ remote: remote: To http://localhost:8002/real_repo.git - * [new reference] master -> refs/stack/master + * [new reference] master -> refs/stack/for/master $ echo contents2 > file3 $ git add file3 $ git commit -m "add file3" 1> /dev/null - $ git push -o author=josh@example.com origin master:refs/stack/master + $ git push -o author=josh@example.com origin master:refs/stack/for/master remote: josh-proxy remote: response from upstream: remote: rejecting to push 3ad32b3bd3bb778441e7eae43930d8dc6293eddc without Change-Id remote: remote: - remote: error: hook declined to update refs/stack/master + remote: error: hook declined to update refs/stack/for/master To http://localhost:8002/real_repo.git - ! [remote rejected] master -> refs/stack/master (hook declined) + ! [remote rejected] master -> refs/stack/for/master (hook declined) error: failed to push some refs to 'http://localhost:8002/real_repo.git' [1] - $ git push -o author=foo@example.com origin master:refs/stack/master + $ git push -o author=foo@example.com origin master:refs/stack/for/master remote: josh-proxy remote: response from upstream: remote: To http://localhost:8001/real_repo.git @@ -73,7 +73,7 @@ remote: remote: To http://localhost:8002/real_repo.git - * [new reference] master -> refs/stack/master + * [new reference] master -> refs/stack/for/master $ curl -s http://localhost:8002/flush Flushed credential cache diff --git a/tests/proxy/push_stacked_split.t b/tests/proxy/push_stacked_split.t index 3db8640f8..fdd1fe082 100644 --- a/tests/proxy/push_stacked_split.t +++ b/tests/proxy/push_stacked_split.t @@ -33,7 +33,7 @@ * Change-Id: foo7 * Change-Id: 1234 * add file1 (origin/master, origin/HEAD) - $ git push -o split -o author=josh@example.com origin master:refs/split/master + $ git push -o split -o author=josh@example.com origin master:refs/split/for/master remote: josh-proxy remote: response from upstream: remote: To http://localhost:8001/real_repo.git @@ -47,7 +47,7 @@ remote: remote: To http://localhost:8002/real_repo.git - * [new reference] master -> refs/split/master + * [new reference] master -> refs/split/for/master $ curl -s http://localhost:8002/flush Flushed credential cache diff --git a/tests/proxy/push_stacked_sub.t b/tests/proxy/push_stacked_sub.t index 1fb743064..40821b93e 100644 --- a/tests/proxy/push_stacked_sub.t +++ b/tests/proxy/push_stacked_sub.t @@ -28,7 +28,7 @@ * Change-Id: foo7 (HEAD -> master) * Change-Id: 1234 * add file1 (origin/master, origin/HEAD) - $ git push -o author=josh@example.com origin master:refs/stack/master + $ git push -o author=josh@example.com origin master:refs/stack/for/master remote: josh-proxy remote: response from upstream: remote: To http://localhost:8001/real_repo.git @@ -40,8 +40,8 @@ remote: remote: To http://localhost:8002/real_repo.git:/sub1.git - * [new reference] master -> refs/stack/master - $ git push -o author=josh@example.com origin master:refs/stack/other_branch + * [new reference] master -> refs/stack/for/master + $ git push -o author=josh@example.com origin master:refs/stack/for/other_branch remote: josh-proxy remote: response from upstream: remote: Reference "refs/heads/other_branch" does not exist on remote. @@ -50,12 +50,12 @@ remote: remote: remote: - remote: error: hook declined to update refs/stack/other_branch + remote: error: hook declined to update refs/stack/for/other_branch To http://localhost:8002/real_repo.git:/sub1.git - ! [remote rejected] master -> refs/stack/other_branch (hook declined) + ! [remote rejected] master -> refs/stack/for/other_branch (hook declined) error: failed to push some refs to 'http://localhost:8002/real_repo.git:/sub1.git' [1] - $ git push -o base=master -o author=josh@example.com origin master:refs/stack/other_branch + $ git push -o base=master -o author=josh@example.com origin master:refs/stack/for/other_branch remote: josh-proxy remote: response from upstream: remote: To http://localhost:8001/real_repo.git @@ -67,19 +67,19 @@ remote: remote: To http://localhost:8002/real_repo.git:/sub1.git - * [new reference] master -> refs/stack/other_branch + * [new reference] master -> refs/stack/for/other_branch $ echo contents2 > file3 $ git add file3 $ git commit -m "add file3" 1> /dev/null - $ git push -o author=josh@example.com origin master:refs/stack/master + $ git push -o author=josh@example.com origin master:refs/stack/for/master remote: josh-proxy remote: response from upstream: remote: rejecting to push a3065162ecee0fecc977ec04a275e10b5e15a39c without Change-Id remote: remote: - remote: error: hook declined to update refs/stack/master + remote: error: hook declined to update refs/stack/for/master To http://localhost:8002/real_repo.git:/sub1.git - ! [remote rejected] master -> refs/stack/master (hook declined) + ! [remote rejected] master -> refs/stack/for/master (hook declined) error: failed to push some refs to 'http://localhost:8002/real_repo.git:/sub1.git' [1]