File tree Expand file tree Collapse file tree 2 files changed +26
-7
lines changed Expand file tree Collapse file tree 2 files changed +26
-7
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ impl GraphQLHelper {
54
54
variables. insert ( k. to_string ( ) , juniper:: InputValue :: scalar ( v. render ( ) ) ) ;
55
55
}
56
56
57
- let ( transaction, transaction_overlay ) =
57
+ let ( transaction, transaction_mirror ) =
58
58
if let Ok ( to) = cache:: Transaction :: open ( & self . repo_path . join ( "overlay" ) , None ) {
59
59
to. repo ( ) . odb ( ) ?. add_disk_alternate (
60
60
self . repo_path
@@ -64,8 +64,8 @@ impl GraphQLHelper {
64
64
. unwrap ( ) ,
65
65
) ?;
66
66
(
67
- cache:: Transaction :: open ( & self . repo_path . join ( "mirror" ) , None ) ?,
68
67
to,
68
+ cache:: Transaction :: open ( & self . repo_path . join ( "mirror" ) , None ) ?,
69
69
)
70
70
} else {
71
71
(
@@ -79,7 +79,7 @@ impl GraphQLHelper {
79
79
None ,
80
80
& graphql:: commit_schema ( self . commit_id ) ,
81
81
& variables,
82
- & graphql:: context ( transaction, transaction_overlay ) ,
82
+ & graphql:: context ( transaction, transaction_mirror ) ,
83
83
) ?;
84
84
85
85
let j = serde_json:: to_string ( & res) ?;
Original file line number Diff line number Diff line change 8
8
9
9
$ mkdir sub1
10
10
$ echo contents1 > sub1/ file1
11
+ $ echo contents > sub1/ test
11
12
$ git add sub1
12
13
$ git commit -m " add file1" 1 > / dev/ null
13
14
19
20
$ cat > x . graphql << EOF
20
21
> query {
21
22
> hash
23
+ > rev(filter: " ::**/file*" )
24
+ > {
25
+ > hash
26
+ > }
22
27
> }
23
28
> EOF
24
29
25
30
$ cat > tmpl_file << EOF
26
31
> param: {{ param_val }}
27
32
> {{ # with (graphql file="x.graphql") as |gql| }}
28
33
> sha: {{ gql. hash }}
34
+ > filter_sha: {{gql. rev. hash}}
29
35
> {{ / with }}
30
36
> EOF
31
37
46
52
* [new reference] HEAD -> refs/ changes/ 123 / 2
47
53
48
54
$ cd $ {TESTTMP}
49
-
55
+ Get works
50
56
$ curl -s http: // localhost: 8002 / real_repo. git:/ sub1. git? get = file1
51
57
contents1
58
+
59
+ Filter once before calling render
60
+ $ git clone http: // localhost: 8002 / real_repo. git::** / file*. git
61
+ Cloning into ' file*' ...
62
+
63
+ Now render still works (used to fail if filtered previously)
64
+ $ curl -s http: // localhost: 8002 / real_repo. git? render= tmpl_file\& param_val = 12345
65
+ param: 12345
66
+ sha: 890148 bbaa6a797bac8aef672a437f2b08635f15
67
+ filter_sha: ffe8d082c1034053534ea8068f4205ac72a1098e
68
+
69
+
70
+ Failing render for lack of variable
52
71
$ curl -i -s http: // localhost: 8002 / real_repo. git? render= tmpl_file
53
72
HTTP/ 1.1 422 Unprocessable Entity\r (esc)
54
73
content-length: 100 \r (esc)
55
74
date: * \r (esc) (glob)
56
75
\r (esc)
57
76
JoshError(Error rendering " tmpl_file" line 1 , col 8 : Variable " param_val" not found in strict mode. ) (no-eol)
58
- $ curl -s http : // localhost : 8002 / real_repo . git ? render = tmpl_file\ & param_val = 12345
59
- param : 12345
60
- sha : 002 d20d28aab1ebe3892b01ec1dfc60d43fc598f
77
+
78
+
79
+
61
80
$ curl -s http: // localhost: 8002 / real_repo. git? get = sub1/ file1
62
81
contents1
63
82
$ curl -s http: // localhost: 8002 / real_repo. git@ refs / changes/ 123 / 2 : nop. git? get = sub2/ on_change
You can’t perform that action at this time.
0 commit comments