File tree Expand file tree Collapse file tree 5 files changed +12
-17
lines changed Expand file tree Collapse file tree 5 files changed +12
-17
lines changed Original file line number Diff line number Diff line change @@ -9,12 +9,8 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
9
9
10
10
RUN=" test-tool ref-store main"
11
11
12
-
13
- test_expect_success ' setup' '
14
- test_commit one
15
- '
16
-
17
- test_expect_success REFFILES ' pack_refs(PACK_REFS_ALL | PACK_REFS_PRUNE)' '
12
+ test_expect_success ' pack_refs(PACK_REFS_ALL | PACK_REFS_PRUNE)' '
13
+ test_commit one &&
18
14
N=`find .git/refs -type f | wc -l` &&
19
15
test "$N" != 0 &&
20
16
$RUN pack-refs 3 &&
@@ -102,12 +98,12 @@ test_expect_success 'reflog_exists(HEAD)' '
102
98
103
99
test_expect_success ' delete_reflog(HEAD)' '
104
100
$RUN delete-reflog HEAD &&
105
- test_must_fail git reflog exists HEAD
101
+ ! test -f .git/logs/ HEAD
106
102
'
107
103
108
104
test_expect_success ' create-reflog(HEAD)' '
109
105
$RUN create-reflog HEAD 1 &&
110
- git reflog exists HEAD
106
+ test -f .git/logs/ HEAD
111
107
'
112
108
113
109
test_expect_success ' delete_ref(refs/heads/foo)' '
Original file line number Diff line number Diff line change @@ -374,9 +374,7 @@ test_expect_failure 'reflog with non-commit entries displays all entries' '
374
374
test_line_count = 3 actual
375
375
'
376
376
377
- # This test takes a lock on an individual ref; this is not supported in
378
- # reftable.
379
- test_expect_success REFFILES ' reflog expire operates on symref not referrent' '
377
+ test_expect_success ' reflog expire operates on symref not referrent' '
380
378
git branch --create-reflog the_symref &&
381
379
git branch --create-reflog referrent &&
382
380
git update-ref referrent HEAD &&
Original file line number Diff line number Diff line change @@ -23,8 +23,7 @@ test_expect_success setup '
23
23
git commit -a -m "Third in one history." &&
24
24
A2=$(git rev-parse --verify HEAD) &&
25
25
26
- git update-ref -d refs/heads/main &&
27
- rm -f .git/index &&
26
+ rm -f .git/refs/heads/main .git/index &&
28
27
29
28
echo >fileA fileA again &&
30
29
echo >subdir/fileB fileB again &&
Original file line number Diff line number Diff line change @@ -241,7 +241,7 @@ test_expect_success 'background auto gc respects lock for all operations' '
241
241
242
242
# create a ref whose loose presence we can use to detect a pack-refs run
243
243
git update-ref refs/heads/should-be-loose HEAD &&
244
- (ls -1 .git/refs/heads .git/reftable >expect || true) &&
244
+ test_path_is_file .git/refs/heads/should-be-loose &&
245
245
246
246
# now fake a concurrent gc that holds the lock; we can use our
247
247
# shell pid so that it looks valid.
@@ -258,8 +258,7 @@ test_expect_success 'background auto gc respects lock for all operations' '
258
258
259
259
# our gc should exit zero without doing anything
260
260
run_and_wait_for_auto_gc &&
261
- (ls -1 .git/refs/heads .git/reftable >actual || true) &&
262
- test_cmp expect actual
261
+ test_path_is_file .git/refs/heads/should-be-loose
263
262
'
264
263
265
264
# DO NOT leave a detached auto gc process running near the end of the
Original file line number Diff line number Diff line change @@ -373,7 +373,10 @@ test_expect_success 'verify upstream fields in branch header' '
373
373
374
374
## Test upstream-gone case. Fake this by pointing
375
375
## origin/initial-branch at a non-existing commit.
376
- git update-ref -d refs/remotes/origin/initial-branch &&
376
+ OLD=$(git rev-parse origin/initial-branch) &&
377
+ NEW=$ZERO_OID &&
378
+ mv .git/packed-refs .git/old-packed-refs &&
379
+ sed "s/$OLD/$NEW/g" <.git/old-packed-refs >.git/packed-refs &&
377
380
378
381
HUF=$(git rev-parse HEAD) &&
379
382
You can’t perform that action at this time.
0 commit comments