@@ -35,15 +35,16 @@ func TestBuildTreeFromFiles(t *testing.T) {
35
35
path : "" ,
36
36
Children : []* Node [models.File ]{
37
37
{
38
- path : "dir1" ,
38
+ path : "./dir1" ,
39
+ CompressionLevel : 1 ,
39
40
Children : []* Node [models.File ]{
40
41
{
41
42
File : & models.File {Path : "dir1/a" },
42
- path : "dir1/a" ,
43
+ path : "./ dir1/a" ,
43
44
},
44
45
{
45
46
File : & models.File {Path : "dir1/b" },
46
- path : "dir1/b" ,
47
+ path : "./ dir1/b" ,
47
48
},
48
49
},
49
50
},
@@ -64,24 +65,29 @@ func TestBuildTreeFromFiles(t *testing.T) {
64
65
path : "" ,
65
66
Children : []* Node [models.File ]{
66
67
{
67
- path : "dir1/dir3 " ,
68
+ path : ". " ,
68
69
Children : []* Node [models.File ]{
69
70
{
70
- File : & models.File {Path : "dir1/dir3/a" },
71
- path : "dir1/dir3/a" ,
71
+ path : "./dir1/dir3" ,
72
+ Children : []* Node [models.File ]{
73
+ {
74
+ File : & models.File {Path : "dir1/dir3/a" },
75
+ path : "./dir1/dir3/a" ,
76
+ },
77
+ },
78
+ CompressionLevel : 1 ,
72
79
},
73
- },
74
- CompressionLevel : 1 ,
75
- },
76
- {
77
- path : "dir2/dir4" ,
78
- Children : []* Node [models.File ]{
79
80
{
80
- File : & models.File {Path : "dir2/dir4/b" },
81
- path : "dir2/dir4/b" ,
81
+ path : "./dir2/dir4" ,
82
+ Children : []* Node [models.File ]{
83
+ {
84
+ File : & models.File {Path : "dir2/dir4/b" },
85
+ path : "./dir2/dir4/b" ,
86
+ },
87
+ },
88
+ CompressionLevel : 1 ,
82
89
},
83
90
},
84
- CompressionLevel : 1 ,
85
91
},
86
92
},
87
93
},
@@ -100,12 +106,17 @@ func TestBuildTreeFromFiles(t *testing.T) {
100
106
path : "" ,
101
107
Children : []* Node [models.File ]{
102
108
{
103
- File : & models.File {Path : "a" },
104
- path : "a" ,
105
- },
106
- {
107
- File : & models.File {Path : "b" },
108
- path : "b" ,
109
+ path : "." ,
110
+ Children : []* Node [models.File ]{
111
+ {
112
+ File : & models.File {Path : "a" },
113
+ path : "./a" ,
114
+ },
115
+ {
116
+ File : & models.File {Path : "b" },
117
+ path : "./b" ,
118
+ },
119
+ },
109
120
},
110
121
},
111
122
},
@@ -126,20 +137,25 @@ func TestBuildTreeFromFiles(t *testing.T) {
126
137
},
127
138
expected : & Node [models.File ]{
128
139
path : "" ,
129
- // it is a little strange that we're not bubbling up our merge conflict
130
- // here but we are technically still in tree mode and that's the rule
131
140
Children : []* Node [models.File ]{
132
141
{
133
- File : & models.File {Path : "a" },
134
- path : "a" ,
135
- },
136
- {
137
- File : & models.File {Path : "b" },
138
- path : "b" ,
139
- },
140
- {
141
- File : & models.File {Path : "z" , HasMergeConflicts : true },
142
- path : "z" ,
142
+ path : "." ,
143
+ // it is a little strange that we're not bubbling up our merge conflict
144
+ // here but we are technically still in tree mode and that's the rule
145
+ Children : []* Node [models.File ]{
146
+ {
147
+ File : & models.File {Path : "a" },
148
+ path : "./a" ,
149
+ },
150
+ {
151
+ File : & models.File {Path : "b" },
152
+ path : "./b" ,
153
+ },
154
+ {
155
+ File : & models.File {Path : "z" , HasMergeConflicts : true },
156
+ path : "./z" ,
157
+ },
158
+ },
143
159
},
144
160
},
145
161
},
@@ -183,12 +199,12 @@ func TestBuildFlatTreeFromFiles(t *testing.T) {
183
199
Children : []* Node [models.File ]{
184
200
{
185
201
File : & models.File {Path : "dir1/a" },
186
- path : "dir1/a" ,
202
+ path : "./ dir1/a" ,
187
203
CompressionLevel : 0 ,
188
204
},
189
205
{
190
206
File : & models.File {Path : "dir1/b" },
191
- path : "dir1/b" ,
207
+ path : "./ dir1/b" ,
192
208
CompressionLevel : 0 ,
193
209
},
194
210
},
@@ -209,12 +225,12 @@ func TestBuildFlatTreeFromFiles(t *testing.T) {
209
225
Children : []* Node [models.File ]{
210
226
{
211
227
File : & models.File {Path : "dir1/a" },
212
- path : "dir1/a" ,
228
+ path : "./ dir1/a" ,
213
229
CompressionLevel : 0 ,
214
230
},
215
231
{
216
232
File : & models.File {Path : "dir2/b" },
217
- path : "dir2/b" ,
233
+ path : "./ dir2/b" ,
218
234
CompressionLevel : 0 ,
219
235
},
220
236
},
@@ -235,11 +251,11 @@ func TestBuildFlatTreeFromFiles(t *testing.T) {
235
251
Children : []* Node [models.File ]{
236
252
{
237
253
File : & models.File {Path : "a" },
238
- path : "a" ,
254
+ path : "./ a" ,
239
255
},
240
256
{
241
257
File : & models.File {Path : "b" },
242
- path : "b" ,
258
+ path : "./ b" ,
243
259
},
244
260
},
245
261
},
@@ -277,27 +293,27 @@ func TestBuildFlatTreeFromFiles(t *testing.T) {
277
293
Children : []* Node [models.File ]{
278
294
{
279
295
File : & models.File {Path : "c1" , HasMergeConflicts : true },
280
- path : "c1" ,
296
+ path : "./ c1" ,
281
297
},
282
298
{
283
299
File : & models.File {Path : "c2" , HasMergeConflicts : true },
284
- path : "c2" ,
300
+ path : "./ c2" ,
285
301
},
286
302
{
287
303
File : & models.File {Path : "b1" , Tracked : true },
288
- path : "b1" ,
304
+ path : "./ b1" ,
289
305
},
290
306
{
291
307
File : & models.File {Path : "b2" , Tracked : true },
292
- path : "b2" ,
308
+ path : "./ b2" ,
293
309
},
294
310
{
295
311
File : & models.File {Path : "a1" , Tracked : false },
296
- path : "a1" ,
312
+ path : "./ a1" ,
297
313
},
298
314
{
299
315
File : & models.File {Path : "a2" , Tracked : false },
300
- path : "a2" ,
316
+ path : "./ a2" ,
301
317
},
302
318
},
303
319
},
@@ -340,15 +356,16 @@ func TestBuildTreeFromCommitFiles(t *testing.T) {
340
356
path : "" ,
341
357
Children : []* Node [models.CommitFile ]{
342
358
{
343
- path : "dir1" ,
359
+ path : "./dir1" ,
360
+ CompressionLevel : 1 ,
344
361
Children : []* Node [models.CommitFile ]{
345
362
{
346
363
File : & models.CommitFile {Path : "dir1/a" },
347
- path : "dir1/a" ,
364
+ path : "./ dir1/a" ,
348
365
},
349
366
{
350
367
File : & models.CommitFile {Path : "dir1/b" },
351
- path : "dir1/b" ,
368
+ path : "./ dir1/b" ,
352
369
},
353
370
},
354
371
},
@@ -369,24 +386,29 @@ func TestBuildTreeFromCommitFiles(t *testing.T) {
369
386
path : "" ,
370
387
Children : []* Node [models.CommitFile ]{
371
388
{
372
- path : "dir1/dir3 " ,
389
+ path : ". " ,
373
390
Children : []* Node [models.CommitFile ]{
374
391
{
375
- File : & models.CommitFile {Path : "dir1/dir3/a" },
376
- path : "dir1/dir3/a" ,
392
+ path : "./dir1/dir3" ,
393
+ Children : []* Node [models.CommitFile ]{
394
+ {
395
+ File : & models.CommitFile {Path : "dir1/dir3/a" },
396
+ path : "./dir1/dir3/a" ,
397
+ },
398
+ },
399
+ CompressionLevel : 1 ,
377
400
},
378
- },
379
- CompressionLevel : 1 ,
380
- },
381
- {
382
- path : "dir2/dir4" ,
383
- Children : []* Node [models.CommitFile ]{
384
401
{
385
- File : & models.CommitFile {Path : "dir2/dir4/b" },
386
- path : "dir2/dir4/b" ,
402
+ path : "./dir2/dir4" ,
403
+ Children : []* Node [models.CommitFile ]{
404
+ {
405
+ File : & models.CommitFile {Path : "dir2/dir4/b" },
406
+ path : "./dir2/dir4/b" ,
407
+ },
408
+ },
409
+ CompressionLevel : 1 ,
387
410
},
388
411
},
389
- CompressionLevel : 1 ,
390
412
},
391
413
},
392
414
},
@@ -405,12 +427,17 @@ func TestBuildTreeFromCommitFiles(t *testing.T) {
405
427
path : "" ,
406
428
Children : []* Node [models.CommitFile ]{
407
429
{
408
- File : & models.CommitFile {Path : "a" },
409
- path : "a" ,
410
- },
411
- {
412
- File : & models.CommitFile {Path : "b" },
413
- path : "b" ,
430
+ path : "." ,
431
+ Children : []* Node [models.CommitFile ]{
432
+ {
433
+ File : & models.CommitFile {Path : "a" },
434
+ path : "./a" ,
435
+ },
436
+ {
437
+ File : & models.CommitFile {Path : "b" },
438
+ path : "./b" ,
439
+ },
440
+ },
414
441
},
415
442
},
416
443
},
@@ -454,12 +481,12 @@ func TestBuildFlatTreeFromCommitFiles(t *testing.T) {
454
481
Children : []* Node [models.CommitFile ]{
455
482
{
456
483
File : & models.CommitFile {Path : "dir1/a" },
457
- path : "dir1/a" ,
484
+ path : "./ dir1/a" ,
458
485
CompressionLevel : 0 ,
459
486
},
460
487
{
461
488
File : & models.CommitFile {Path : "dir1/b" },
462
- path : "dir1/b" ,
489
+ path : "./ dir1/b" ,
463
490
CompressionLevel : 0 ,
464
491
},
465
492
},
@@ -480,12 +507,12 @@ func TestBuildFlatTreeFromCommitFiles(t *testing.T) {
480
507
Children : []* Node [models.CommitFile ]{
481
508
{
482
509
File : & models.CommitFile {Path : "dir1/a" },
483
- path : "dir1/a" ,
510
+ path : "./ dir1/a" ,
484
511
CompressionLevel : 0 ,
485
512
},
486
513
{
487
514
File : & models.CommitFile {Path : "dir2/b" },
488
- path : "dir2/b" ,
515
+ path : "./ dir2/b" ,
489
516
CompressionLevel : 0 ,
490
517
},
491
518
},
@@ -506,11 +533,11 @@ func TestBuildFlatTreeFromCommitFiles(t *testing.T) {
506
533
Children : []* Node [models.CommitFile ]{
507
534
{
508
535
File : & models.CommitFile {Path : "a" },
509
- path : "a" ,
536
+ path : "./ a" ,
510
537
},
511
538
{
512
539
File : & models.CommitFile {Path : "b" },
513
- path : "b" ,
540
+ path : "./ b" ,
514
541
},
515
542
},
516
543
},
0 commit comments