File tree Expand file tree Collapse file tree 5 files changed +17
-12
lines changed Expand file tree Collapse file tree 5 files changed +17
-12
lines changed Original file line number Diff line number Diff line change @@ -9,8 +9,12 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
9
9
10
10
RUN=" test-tool ref-store main"
11
11
12
- test_expect_success ' pack_refs(PACK_REFS_ALL | PACK_REFS_PRUNE)' '
13
- test_commit one &&
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)' '
14
18
N=`find .git/refs -type f | wc -l` &&
15
19
test "$N" != 0 &&
16
20
$RUN pack-refs 3 &&
@@ -98,12 +102,12 @@ test_expect_success 'reflog_exists(HEAD)' '
98
102
99
103
test_expect_success ' delete_reflog(HEAD)' '
100
104
$RUN delete-reflog HEAD &&
101
- ! test -f .git/logs/ HEAD
105
+ test_must_fail git reflog exists HEAD
102
106
'
103
107
104
108
test_expect_success ' create-reflog(HEAD)' '
105
109
$RUN create-reflog HEAD 1 &&
106
- test -f .git/logs/ HEAD
110
+ git reflog exists HEAD
107
111
'
108
112
109
113
test_expect_success ' delete_ref(refs/heads/foo)' '
Original file line number Diff line number Diff line change @@ -374,7 +374,9 @@ test_expect_failure 'reflog with non-commit entries displays all entries' '
374
374
test_line_count = 3 actual
375
375
'
376
376
377
- test_expect_success ' reflog expire operates on symref not referrent' '
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' '
378
380
git branch --create-reflog the_symref &&
379
381
git branch --create-reflog referrent &&
380
382
git update-ref referrent HEAD &&
Original file line number Diff line number Diff line change @@ -23,7 +23,8 @@ 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
- rm -f .git/refs/heads/main .git/index &&
26
+ git update-ref -d refs/heads/main &&
27
+ rm -f .git/index &&
27
28
28
29
echo >fileA fileA again &&
29
30
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
- test_path_is_file .git/refs/heads/should-be-loose &&
244
+ (ls -1 .git/refs/heads .git/reftable >expect || true) &&
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,7 +258,8 @@ 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
- test_path_is_file .git/refs/heads/should-be-loose
261
+ (ls -1 .git/refs/heads .git/reftable >actual || true) &&
262
+ test_cmp expect actual
262
263
'
263
264
264
265
# 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,10 +373,7 @@ 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
- 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 &&
376
+ git update-ref -d refs/remotes/origin/initial-branch &&
380
377
381
378
HUF=$(git rev-parse HEAD) &&
382
379
You can’t perform that action at this time.
0 commit comments