@@ -37,15 +37,15 @@ test_expect_success setup '
37
37
38
38
test_expect_success " create $m " '
39
39
git update-ref $m $A &&
40
- test $A = $(cat . git/ $m)
40
+ test $A = $(git show-ref -s --verify $m)
41
41
'
42
42
test_expect_success " create $m with oldvalue verification" '
43
43
git update-ref $m $B $A &&
44
- test $B = $(cat . git/ $m)
44
+ test $B = $(git show-ref -s --verify $m)
45
45
'
46
46
test_expect_success " fail to delete $m with stale ref" '
47
47
test_must_fail git update-ref -d $m $A &&
48
- test $B = "$(cat . git/ $m)"
48
+ test $B = "$(git show-ref -s --verify $m)"
49
49
'
50
50
test_expect_success " delete $m " '
51
51
test_when_finished "rm -f .git/$m" &&
@@ -56,7 +56,7 @@ test_expect_success "delete $m" '
56
56
test_expect_success " delete $m without oldvalue verification" '
57
57
test_when_finished "rm -f .git/$m" &&
58
58
git update-ref $m $A &&
59
- test $A = $(cat . git/ $m) &&
59
+ test $A = $(git show-ref -s --verify $m) &&
60
60
git update-ref -d $m &&
61
61
test_path_is_missing .git/$m
62
62
'
@@ -69,15 +69,15 @@ test_expect_success "fail to create $n" '
69
69
70
70
test_expect_success " create $m (by HEAD)" '
71
71
git update-ref HEAD $A &&
72
- test $A = $(cat . git/ $m)
72
+ test $A = $(git show-ref -s --verify $m)
73
73
'
74
74
test_expect_success " create $m (by HEAD) with oldvalue verification" '
75
75
git update-ref HEAD $B $A &&
76
- test $B = $(cat . git/ $m)
76
+ test $B = $(git show-ref -s --verify $m)
77
77
'
78
78
test_expect_success " fail to delete $m (by HEAD) with stale ref" '
79
79
test_must_fail git update-ref -d HEAD $A &&
80
- test $B = $(cat . git/ $m)
80
+ test $B = $(git show-ref -s --verify $m)
81
81
'
82
82
test_expect_success " delete $m (by HEAD)" '
83
83
test_when_finished "rm -f .git/$m" &&
@@ -178,14 +178,14 @@ test_expect_success '--no-create-reflog overrides core.logAllRefUpdates=always'
178
178
179
179
test_expect_success " create $m (by HEAD)" '
180
180
git update-ref HEAD $A &&
181
- test $A = $(cat . git/ $m)
181
+ test $A = $(git show-ref -s --verify $m)
182
182
'
183
183
test_expect_success ' pack refs' '
184
184
git pack-refs --all
185
185
'
186
186
test_expect_success " move $m (by HEAD)" '
187
187
git update-ref HEAD $B $A &&
188
- test $B = $(cat . git/ $m)
188
+ test $B = $(git show-ref -s --verify $m)
189
189
'
190
190
test_expect_success " delete $m (by HEAD) should remove both packed and loose $m " '
191
191
test_when_finished "rm -f .git/$m" &&
@@ -255,27 +255,27 @@ test_expect_success '(not) change HEAD with wrong SHA1' '
255
255
'
256
256
test_expect_success " (not) changed .git/$m " '
257
257
test_when_finished "rm -f .git/$m" &&
258
- ! test $B = $(cat . git/ $m)
258
+ ! test $B = $(git show-ref -s --verify $m)
259
259
'
260
260
261
261
rm -f .git/logs/refs/heads/master
262
262
test_expect_success " create $m (logged by touch)" '
263
263
test_config core.logAllRefUpdates false &&
264
264
GIT_COMMITTER_DATE="2005-05-26 23:30" \
265
265
git update-ref --create-reflog HEAD $A -m "Initial Creation" &&
266
- test $A = $(cat . git/ $m)
266
+ test $A = $(git show-ref -s --verify $m)
267
267
'
268
268
test_expect_success " update $m (logged by touch)" '
269
269
test_config core.logAllRefUpdates false &&
270
270
GIT_COMMITTER_DATE="2005-05-26 23:31" \
271
271
git update-ref HEAD $B $A -m "Switch" &&
272
- test $B = $(cat . git/ $m)
272
+ test $B = $(git show-ref -s --verify $m)
273
273
'
274
274
test_expect_success " set $m (logged by touch)" '
275
275
test_config core.logAllRefUpdates false &&
276
276
GIT_COMMITTER_DATE="2005-05-26 23:41" \
277
277
git update-ref HEAD $A &&
278
- test $A = $(cat . git/ $m)
278
+ test $A = $(git show-ref -s --verify $m)
279
279
'
280
280
281
281
test_expect_success ' empty directory removal' '
@@ -319,19 +319,19 @@ test_expect_success "create $m (logged by config)" '
319
319
test_config core.logAllRefUpdates true &&
320
320
GIT_COMMITTER_DATE="2005-05-26 23:32" \
321
321
git update-ref HEAD $A -m "Initial Creation" &&
322
- test $A = $(cat . git/ $m)
322
+ test $A = $(git show-ref -s --verify $m)
323
323
'
324
324
test_expect_success " update $m (logged by config)" '
325
325
test_config core.logAllRefUpdates true &&
326
326
GIT_COMMITTER_DATE="2005-05-26 23:33" \
327
327
git update-ref HEAD' " $B $A " ' -m "Switch" &&
328
- test $B = $(cat . git/ $m)
328
+ test $B = $(git show-ref -s --verify $m)
329
329
'
330
330
test_expect_success " set $m (logged by config)" '
331
331
test_config core.logAllRefUpdates true &&
332
332
GIT_COMMITTER_DATE="2005-05-26 23:43" \
333
333
git update-ref HEAD $A &&
334
- test $A = $(cat . git/ $m)
334
+ test $A = $(git show-ref -s --verify $m)
335
335
'
336
336
337
337
cat > expect << EOF
0 commit comments