Skip to content

Commit 030ad93

Browse files
christian-schillingLMG
authored andcommitted
Change magic refs to include "for"
This is a bit more consistent with the magic ref used by gerrit. Change-Id: magic-refs
1 parent 3b85b9d commit 030ad93

File tree

4 files changed

+25
-25
lines changed

4 files changed

+25
-25
lines changed

josh-proxy/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ fn baseref_and_options(refname: &str) -> josh::JoshResult<(String, String, Vec<S
3333
push_mode = PushMode::Review;
3434
baseref = baseref.replacen("refs/drafts", "refs/heads", 1)
3535
}
36-
if baseref.starts_with("refs/stack") {
36+
if baseref.starts_with("refs/stack/for") {
3737
push_mode = PushMode::Stack;
38-
baseref = baseref.replacen("refs/stack", "refs/heads", 1)
38+
baseref = baseref.replacen("refs/stack/for", "refs/heads", 1)
3939
}
40-
if baseref.starts_with("refs/split") {
40+
if baseref.starts_with("refs/split/for") {
4141
push_mode = PushMode::Split;
42-
baseref = baseref.replacen("refs/split", "refs/heads", 1)
42+
baseref = baseref.replacen("refs/split/for", "refs/heads", 1)
4343
}
4444
Ok((baseref, push_to, options, push_mode))
4545
}

tests/proxy/push_stacked.t

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@
2929
* Change-Id: foo7 (HEAD -> master)
3030
* Change-Id: 1234
3131
* add file1 (origin/master, origin/HEAD)
32-
$ git push -o author=foo@example.com origin master:refs/stack/master
32+
$ git push -o author=foo@example.com origin master:refs/stack/for/master
3333
remote: josh-proxy
3434
remote: response from upstream:
3535
remote: To http://localhost:8001/real_repo.git
3636
remote: * [new branch] master -> @heads/master/foo@example.com
3737
remote:
3838
remote:
3939
To http://localhost:8002/real_repo.git
40-
* [new reference] master -> refs/stack/master
41-
$ git push -o author=josh@example.com origin master:refs/stack/master
40+
* [new reference] master -> refs/stack/for/master
41+
$ git push -o author=josh@example.com origin master:refs/stack/for/master
4242
remote: josh-proxy
4343
remote: response from upstream:
4444
remote: To http://localhost:8001/real_repo.git
@@ -50,30 +50,30 @@
5050
remote:
5151
remote:
5252
To http://localhost:8002/real_repo.git
53-
* [new reference] master -> refs/stack/master
53+
* [new reference] master -> refs/stack/for/master
5454
$ echo contents2 > file3
5555
$ git add file3
5656
$ git commit -m "add file3" 1> /dev/null
57-
$ git push -o author=josh@example.com origin master:refs/stack/master
57+
$ git push -o author=josh@example.com origin master:refs/stack/for/master
5858
remote: josh-proxy
5959
remote: response from upstream:
6060
remote: rejecting to push 3ad32b3bd3bb778441e7eae43930d8dc6293eddc without Change-Id
6161
remote:
6262
remote:
63-
remote: error: hook declined to update refs/stack/master
63+
remote: error: hook declined to update refs/stack/for/master
6464
To http://localhost:8002/real_repo.git
65-
! [remote rejected] master -> refs/stack/master (hook declined)
65+
! [remote rejected] master -> refs/stack/for/master (hook declined)
6666
error: failed to push some refs to 'http://localhost:8002/real_repo.git'
6767
[1]
68-
$ git push -o author=foo@example.com origin master:refs/stack/master
68+
$ git push -o author=foo@example.com origin master:refs/stack/for/master
6969
remote: josh-proxy
7070
remote: response from upstream:
7171
remote: To http://localhost:8001/real_repo.git
7272
remote: ec41aad..3ad32b3 master -> @heads/master/foo@example.com
7373
remote:
7474
remote:
7575
To http://localhost:8002/real_repo.git
76-
* [new reference] master -> refs/stack/master
76+
* [new reference] master -> refs/stack/for/master
7777

7878
$ curl -s http://localhost:8002/flush
7979
Flushed credential cache

tests/proxy/push_stacked_split.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* Change-Id: foo7
3434
* Change-Id: 1234
3535
* add file1 (origin/master, origin/HEAD)
36-
$ git push -o split -o author=josh@example.com origin master:refs/split/master
36+
$ git push -o split -o author=josh@example.com origin master:refs/split/for/master
3737
remote: josh-proxy
3838
remote: response from upstream:
3939
remote: To http://localhost:8001/real_repo.git
@@ -47,7 +47,7 @@
4747
remote:
4848
remote:
4949
To http://localhost:8002/real_repo.git
50-
* [new reference] master -> refs/split/master
50+
* [new reference] master -> refs/split/for/master
5151

5252
$ curl -s http://localhost:8002/flush
5353
Flushed credential cache

tests/proxy/push_stacked_sub.t

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* Change-Id: foo7 (HEAD -> master)
2929
* Change-Id: 1234
3030
* add file1 (origin/master, origin/HEAD)
31-
$ git push -o author=josh@example.com origin master:refs/stack/master
31+
$ git push -o author=josh@example.com origin master:refs/stack/for/master
3232
remote: josh-proxy
3333
remote: response from upstream:
3434
remote: To http://localhost:8001/real_repo.git
@@ -40,8 +40,8 @@
4040
remote:
4141
remote:
4242
To http://localhost:8002/real_repo.git:/sub1.git
43-
* [new reference] master -> refs/stack/master
44-
$ git push -o author=josh@example.com origin master:refs/stack/other_branch
43+
* [new reference] master -> refs/stack/for/master
44+
$ git push -o author=josh@example.com origin master:refs/stack/for/other_branch
4545
remote: josh-proxy
4646
remote: response from upstream:
4747
remote: Reference "refs/heads/other_branch" does not exist on remote.
@@ -50,12 +50,12 @@
5050
remote:
5151
remote:
5252
remote:
53-
remote: error: hook declined to update refs/stack/other_branch
53+
remote: error: hook declined to update refs/stack/for/other_branch
5454
To http://localhost:8002/real_repo.git:/sub1.git
55-
! [remote rejected] master -> refs/stack/other_branch (hook declined)
55+
! [remote rejected] master -> refs/stack/for/other_branch (hook declined)
5656
error: failed to push some refs to 'http://localhost:8002/real_repo.git:/sub1.git'
5757
[1]
58-
$ git push -o base=master -o author=josh@example.com origin master:refs/stack/other_branch
58+
$ git push -o base=master -o author=josh@example.com origin master:refs/stack/for/other_branch
5959
remote: josh-proxy
6060
remote: response from upstream:
6161
remote: To http://localhost:8001/real_repo.git
@@ -67,19 +67,19 @@
6767
remote:
6868
remote:
6969
To http://localhost:8002/real_repo.git:/sub1.git
70-
* [new reference] master -> refs/stack/other_branch
70+
* [new reference] master -> refs/stack/for/other_branch
7171
$ echo contents2 > file3
7272
$ git add file3
7373
$ git commit -m "add file3" 1> /dev/null
74-
$ git push -o author=josh@example.com origin master:refs/stack/master
74+
$ git push -o author=josh@example.com origin master:refs/stack/for/master
7575
remote: josh-proxy
7676
remote: response from upstream:
7777
remote: rejecting to push a3065162ecee0fecc977ec04a275e10b5e15a39c without Change-Id
7878
remote:
7979
remote:
80-
remote: error: hook declined to update refs/stack/master
80+
remote: error: hook declined to update refs/stack/for/master
8181
To http://localhost:8002/real_repo.git:/sub1.git
82-
! [remote rejected] master -> refs/stack/master (hook declined)
82+
! [remote rejected] master -> refs/stack/for/master (hook declined)
8383
error: failed to push some refs to 'http://localhost:8002/real_repo.git:/sub1.git'
8484
[1]
8585

0 commit comments

Comments
 (0)