Skip to content

Commit caa1588

Browse files
authored
Add test showing history bug (#899)
Change-Id: history_bug
1 parent 47dd595 commit caa1588

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

tests/filter/graphql_history.t

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
$ export TESTTMP=${PWD}
2+
3+
$ cd ${TESTTMP}
4+
$ git init -q repo 1> /dev/null
5+
$ cd repo
6+
7+
$ echo contents0 > file1
8+
$ git add .
9+
$ git commit -m "add file1" 1> /dev/null
10+
$ echo contents2 > file2
11+
$ git add .
12+
$ git commit -m "add file2" 1> /dev/null
13+
$ mkdir ws
14+
$ cat > ws/workspace.josh <<EOF
15+
> ::file2
16+
> EOF
17+
$ git add .
18+
$ git commit -m "add ws" 1> /dev/null
19+
20+
$ cat > query <<EOF
21+
> query {
22+
> rev(at: "HEAD", filter: ":workspace=ws") {
23+
> history(limit: 1) {
24+
> summary
25+
> }
26+
> }
27+
> }
28+
> EOF
29+
30+
$ josh-filter -g "$(cat query)"
31+
{"rev":{"history":[{"summary":"add ws"}]}}
32+
33+
$ cat > query2 <<EOF
34+
> query {
35+
> rev(at: "HEAD", filter: ":workspace=ws") {
36+
> history(limit: 2) {
37+
> summary
38+
> }
39+
> }
40+
> }
41+
> EOF
42+
43+
$ josh-filter -g "$(cat query2)"
44+
null

0 commit comments

Comments
 (0)