@@ -119,25 +119,27 @@ describe('branch', () => {
119
119
current : false ,
120
120
label : 'Something' ,
121
121
name : 'branch-012de2' ,
122
+ linkedWorkTree : false ,
122
123
} ,
123
124
'branch-012de3' : {
124
125
commit : '012de3' ,
125
126
current : true ,
126
127
label : 'Add support for carriage \r returns' ,
127
128
name : 'branch-012de3' ,
129
+ linkedWorkTree : false ,
128
130
} ,
129
131
'branch-012de4' : {
130
132
commit : '012de4' ,
131
133
current : false ,
132
134
label : 'Something else' ,
133
135
name : 'branch-012de4' ,
136
+ linkedWorkTree : false ,
134
137
} ,
135
138
}
136
139
} ) )
137
140
} ) ;
138
141
139
142
140
-
141
143
it ( 'branch detail by name' , async ( ) => {
142
144
const actual = parseBranchSummary ( `
143
145
cflynn07-add-git-ignore a0b67a3 Add support for filenames containing spaces
@@ -154,18 +156,21 @@ describe('branch', () => {
154
156
current : false ,
155
157
label : 'Add support for filenames containing spaces' ,
156
158
name : 'cflynn07-add-git-ignore' ,
159
+ linkedWorkTree : false ,
157
160
} ,
158
161
'drschwabe-add-branches' : {
159
162
commit : '063069b' ,
160
163
current : true ,
161
164
label : `Merge branch 'add-branches' of https://github.com/user/repo into drschwabe-add-branches` ,
162
165
name : 'drschwabe-add-branches' ,
166
+ linkedWorkTree : false ,
163
167
} ,
164
168
master : {
165
169
commit : 'cb4be06' ,
166
170
current : false ,
167
171
label : 'Release 1.30.0' ,
168
172
name : 'master' ,
173
+ linkedWorkTree : false ,
169
174
} ,
170
175
} ,
171
176
} ) ) ;
@@ -210,6 +215,42 @@ describe('branch', () => {
210
215
} ) ) ;
211
216
} ) ;
212
217
218
+ it ( `branches in linked work trees` , ( ) => {
219
+ const actual = parseBranchSummary ( `
220
+ main 3c43b1d first
221
+ * x e94b8dd second
222
+ + y 3c43b1d first
223
+ ` ) ;
224
+
225
+ expect ( actual ) . toEqual ( like ( {
226
+ current : 'x' ,
227
+ all : [ 'main' , 'x' , 'y' ] ,
228
+ branches : {
229
+ main : {
230
+ commit : '3c43b1d' ,
231
+ current : false ,
232
+ label : 'first' ,
233
+ linkedWorkTree : false ,
234
+ name : 'main' ,
235
+ } ,
236
+ x : {
237
+ commit : 'e94b8dd' ,
238
+ current : true ,
239
+ label : 'second' ,
240
+ linkedWorkTree : false ,
241
+ name : 'x' ,
242
+ } ,
243
+ y : {
244
+ commit : '3c43b1d' ,
245
+ current : false ,
246
+ label : 'first' ,
247
+ linkedWorkTree : true ,
248
+ name : 'y' ,
249
+ } ,
250
+ }
251
+ } ) ) ;
252
+ } )
253
+
213
254
it ( 'branches without labels' , async ( ) => {
214
255
const actual = parseBranchSummary ( `
215
256
* stable f8cc2bc
@@ -225,8 +266,9 @@ describe('branch', () => {
225
266
current : true ,
226
267
label : '' ,
227
268
name : 'stable' ,
269
+ linkedWorkTree : false ,
228
270
} ,
229
- [ 'remotes/origin/stable' ] : {
271
+ 'remotes/origin/stable' : {
230
272
commit : 'f8cc2bd' ,
231
273
current : false ,
232
274
label : '' ,
@@ -237,6 +279,7 @@ describe('branch', () => {
237
279
current : false ,
238
280
label : 'wip' ,
239
281
name : 'dev' ,
282
+ linkedWorkTree : false ,
240
283
} ,
241
284
}
242
285
} ) ) ;
0 commit comments