@@ -49,11 +49,15 @@ test_atom() {
49
49
}
50
50
51
51
test_atom head refname refs/heads/master
52
+ test_atom head refname:short master
52
53
test_atom head upstream refs/remotes/origin/master
54
+ test_atom head upstream:short origin/master
53
55
test_atom head push refs/remotes/myfork/master
56
+ test_atom head push:short myfork/master
54
57
test_atom head objecttype commit
55
58
test_atom head objectsize 171
56
59
test_atom head objectname $( git rev-parse refs/heads/master)
60
+ test_atom head objectname:short $( git rev-parse --short refs/heads/master)
57
61
test_atom head tree $( git rev-parse refs/heads/master^{tree})
58
62
test_atom head parent ' '
59
63
test_atom head numparent 0
@@ -86,11 +90,13 @@ test_atom head contents 'Initial
86
90
test_atom head HEAD ' *'
87
91
88
92
test_atom tag refname refs/tags/testtag
93
+ test_atom tag refname:short testtag
89
94
test_atom tag upstream ' '
90
95
test_atom tag push ' '
91
96
test_atom tag objecttype tag
92
97
test_atom tag objectsize 154
93
98
test_atom tag objectname $( git rev-parse refs/tags/testtag)
99
+ test_atom tag objectname:short $( git rev-parse --short refs/tags/testtag)
94
100
test_atom tag tree ' '
95
101
test_atom tag parent ' '
96
102
test_atom tag numparent ' '
@@ -338,47 +344,14 @@ for i in "--perl --shell" "-s --python" "--python --tcl" "--tcl --perl"; do
338
344
"
339
345
done
340
346
341
- cat > expected << \EOF
342
- master
343
- testtag
344
- EOF
345
-
346
- test_expect_success ' Check short refname format' '
347
- (git for-each-ref --format="%(refname:short)" refs/heads &&
348
- git for-each-ref --format="%(refname:short)" refs/tags) >actual &&
349
- test_cmp expected actual
350
- '
351
-
352
- cat > expected << EOF
353
- origin/master
354
- EOF
355
-
356
- test_expect_success ' Check short upstream format' '
357
- git for-each-ref --format="%(upstream:short)" refs/heads >actual &&
358
- test_cmp expected actual
359
- '
360
-
361
347
test_expect_success ' setup for upstream:track[short]' '
362
348
test_commit two
363
349
'
364
350
365
- cat > expected << EOF
366
- [ahead 1]
367
- EOF
368
-
369
- test_expect_success ' Check upstream:track format' '
370
- git for-each-ref --format="%(upstream:track)" refs/heads >actual &&
371
- test_cmp expected actual
372
- '
373
-
374
- cat > expected << EOF
375
- >
376
- EOF
377
-
378
- test_expect_success ' Check upstream:trackshort format' '
379
- git for-each-ref --format="%(upstream:trackshort)" refs/heads >actual &&
380
- test_cmp expected actual
381
- '
351
+ test_atom head upstream:track ' [ahead 1]'
352
+ test_atom head upstream:trackshort ' >'
353
+ test_atom head push:track ' [ahead 1]'
354
+ test_atom head push:trackshort ' >'
382
355
383
356
test_expect_success ' Check that :track[short] cannot be used with other atoms' '
384
357
test_must_fail git for-each-ref --format="%(refname:track)" 2>/dev/null &&
@@ -398,21 +371,6 @@ test_expect_success 'Check that :track[short] works when upstream is invalid' '
398
371
test_cmp expected actual
399
372
'
400
373
401
- test_expect_success ' %(push) supports tracking specifiers, too' '
402
- echo "[ahead 1]" >expected &&
403
- git for-each-ref --format="%(push:track)" refs/heads >actual &&
404
- test_cmp expected actual
405
- '
406
-
407
- cat > expected << EOF
408
- $( git rev-parse --short HEAD)
409
- EOF
410
-
411
- test_expect_success ' Check short objectname format' '
412
- git for-each-ref --format="%(objectname:short)" refs/heads >actual &&
413
- test_cmp expected actual
414
- '
415
-
416
374
test_expect_success ' Check for invalid refname format' '
417
375
test_must_fail git for-each-ref --format="%(refname:INVALID)"
418
376
'
0 commit comments