File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -1402,9 +1402,13 @@ async fn serve_query(
1402
1402
. unwrap ( ) ,
1403
1403
) ?;
1404
1404
1405
- let commit_id = transaction_mirror
1406
- . repo ( )
1407
- . refname_to_id ( & transaction_mirror. refname ( & head_ref) ) ?;
1405
+ let commit_id = if let Ok ( oid) = git2:: Oid :: from_str ( & head_ref) {
1406
+ oid
1407
+ } else {
1408
+ transaction_mirror
1409
+ . repo ( )
1410
+ . refname_to_id ( & transaction_mirror. refname ( & head_ref) ) ?
1411
+ } ;
1408
1412
let commit_id =
1409
1413
josh:: filter_commit ( & transaction, filter, commit_id, josh:: filter:: empty ( ) ) ?;
1410
1414
Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ Now render still works (used to fail if filtered previously)
69
69
param: 12345
70
70
sha: 890148 bbaa6a797bac8aef672a437f2b08635f15
71
71
filter_sha: ffe8d082c1034053534ea8068f4205ac72a1098e
72
+
72
73
$ curl -s -i http: // localhost: 8002 / real_repo. git? render= tmpl_file\& param_val = 12345 | grep -v date:
73
74
HTTP/ 1.1 200 OK\r (esc)
74
75
content-type: text/ plain\r (esc)
@@ -78,6 +79,16 @@ Now render still works (used to fail if filtered previously)
78
79
sha: 890148 bbaa6a797bac8aef672a437f2b08635f15
79
80
filter_sha: ffe8d082c1034053534ea8068f4205ac72a1098e
80
81
82
+ $ curl -s http: // localhost: 8002 / real_repo. git@ refs / heads/ master? render= tmpl_file\& param_val = 12345 | grep -v date:
83
+ param: 12345
84
+ sha: 890148 bbaa6a797bac8aef672a437f2b08635f15
85
+ filter_sha: ffe8d082c1034053534ea8068f4205ac72a1098e
86
+
87
+ $ curl -s http: // localhost: 8002 / real_repo. git@890148bbaa6a797bac8aef672a437f2b08635f15? render= tmpl_file\& param_val = 12345 | grep -v date:
88
+ param: 12345
89
+ sha: 890148 bbaa6a797bac8aef672a437f2b08635f15
90
+ filter_sha: ffe8d082c1034053534ea8068f4205ac72a1098e
91
+
81
92
Graphql works
82
93
$ curl -s http: // localhost: 8002 / real_repo. git? graphql= x . graphql
83
94
{
You can’t perform that action at this time.
0 commit comments