Skip to content

Commit b53940c

Browse files
Extend auto discovered subdir filters to include prefix (#1072)
This is a very common usage in workspace, so precompute it. Change: precompute-prefix
1 parent 2996dd8 commit b53940c

39 files changed

+154
-107
lines changed

src/housekeeping.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ pub fn find_all_workspaces_and_subdirectories(
208208
if root.is_empty() {
209209
return 0;
210210
}
211-
let v = format!(":/{}", root.trim_matches('/'));
211+
let v = format!("::{}/", root.trim_matches('/'));
212212
if v.chars().filter(|x| *x == '/').count() < 3 {
213213
hs.insert(v);
214214
}

tests/proxy/amend_patchset.t

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,10 @@
118118
1 directory, 4 files
119119

120120
$ bash ${TESTDIR}/destroy_test_env.sh
121-
"real_repo.git" = [':/sub3']
121+
"real_repo.git" = [
122+
':/sub3',
123+
'::sub3/',
124+
]
122125
.
123126
|-- josh
124127
| `-- 14

tests/proxy/authentication.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
* add file1
122122
123123
$ bash ${TESTDIR}/destroy_test_env.sh
124-
"real_repo.git" = [':/sub1']
124+
"real_repo.git" = ['::sub1/']
125125
.
126126
|-- josh
127127
| `-- 14

tests/proxy/caching.t

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@
4545
fetch_cached_ok true
4646

4747
$ bash ${TESTDIR}/destroy_test_env.sh
48-
"real_repo.git" = [':/sub1']
48+
"real_repo.git" = [
49+
':/sub1',
50+
'::sub1/',
51+
]
4952
.
5053
|-- josh
5154
| `-- 14
@@ -153,7 +156,10 @@
153156
$ grep -o "fetch_cached_ok true" ${TESTTMP}/josh-proxy.out | uniq
154157

155158
$ bash ${TESTDIR}/destroy_test_env.sh
156-
"real_repo.git" = [':/sub1']
159+
"real_repo.git" = [
160+
':/sub1',
161+
'::sub1/',
162+
]
157163
.
158164
|-- josh
159165
| `-- 14

tests/proxy/clone_all.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050

5151

5252
$ bash ${TESTDIR}/destroy_test_env.sh
53-
"real_repo.git" = [':/sub1']
53+
"real_repo.git" = ['::sub1/']
5454
.
5555
|-- josh
5656
| `-- 14

tests/proxy/clone_locked_refs.t

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,14 @@
9999

100100
$ bash ${TESTDIR}/destroy_test_env.sh
101101
"meta_repo.git" = [
102-
':/locked.git',
103-
':/path',
104-
':/path/to',
102+
'::locked.git/',
103+
'::path/',
104+
'::path/to/',
105105
]
106106
"real_repo.git" = [
107-
':/sub1',
108-
':/sub2',
109-
':/sub3',
107+
'::sub1/',
108+
'::sub2/',
109+
'::sub3/',
110110
':prefix=my_prefix',
111111
]
112112
.

tests/proxy/clone_prefix.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@
6868

6969
$ bash ${TESTDIR}/destroy_test_env.sh
7070
"real_repo.git" = [
71-
':/sub1',
72-
':/sub2',
71+
'::sub1/',
72+
'::sub2/',
7373
':prefix=pre',
7474
]
7575
.

tests/proxy/clone_sha.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575

7676

7777
$ bash ${TESTDIR}/destroy_test_env.sh
78-
"real_repo.git" = [':/sub1']
78+
"real_repo.git" = ['::sub1/']
7979
.
8080
|-- josh
8181
| `-- 14

tests/proxy/clone_subsubtree.t

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@
8181
"real_repo.git" = [
8282
':/sub1',
8383
':/sub1/subsub',
84-
':/sub2',
84+
'::sub1/',
85+
'::sub1/subsub/',
86+
'::sub2/',
8587
]
8688
.
8789
|-- josh

tests/proxy/clone_subtree.t

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@
8080
$ bash ${TESTDIR}/destroy_test_env.sh
8181
"real_repo.git" = [
8282
':/sub1',
83-
':/sub2',
83+
'::sub1/',
84+
'::sub2/',
8485
]
8586
.
8687
|-- josh

0 commit comments

Comments
 (0)