Skip to content

Commit 485c63c

Browse files
pks-tgitster
authored andcommitted
reftable: remove name checks
In the preceding commit we have disabled name checks in the "reftable" backend. These checks were responsible for verifying multiple things when writing records to the reftable stack: - Detecting file/directory conflicts. Starting with the preceding commits this is now handled by the reftable backend itself via `refs_verify_refname_available()`. - Validating refnames. This is handled by `check_refname_format()` in the generic ref transacton layer. The code in the reftable library is thus not used anymore and likely to bitrot over time. Remove it. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4af31dc commit 485c63c

File tree

12 files changed

+1
-462
lines changed

12 files changed

+1
-462
lines changed

Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2655,7 +2655,6 @@ REFTABLE_OBJS += reftable/merged.o
26552655
REFTABLE_OBJS += reftable/pq.o
26562656
REFTABLE_OBJS += reftable/reader.o
26572657
REFTABLE_OBJS += reftable/record.o
2658-
REFTABLE_OBJS += reftable/refname.o
26592658
REFTABLE_OBJS += reftable/generic.o
26602659
REFTABLE_OBJS += reftable/stack.o
26612660
REFTABLE_OBJS += reftable/tree.o
@@ -2668,7 +2667,6 @@ REFTABLE_TEST_OBJS += reftable/merged_test.o
26682667
REFTABLE_TEST_OBJS += reftable/pq_test.o
26692668
REFTABLE_TEST_OBJS += reftable/record_test.o
26702669
REFTABLE_TEST_OBJS += reftable/readwrite_test.o
2671-
REFTABLE_TEST_OBJS += reftable/refname_test.o
26722670
REFTABLE_TEST_OBJS += reftable/stack_test.o
26732671
REFTABLE_TEST_OBJS += reftable/test_framework.o
26742672
REFTABLE_TEST_OBJS += reftable/tree_test.o

refs/reftable-backend.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -247,11 +247,6 @@ static struct ref_store *reftable_be_init(struct repository *repo,
247247
refs->write_options.block_size = 4096;
248248
refs->write_options.hash_id = repo->hash_algo->format_id;
249249
refs->write_options.default_permissions = calc_shared_perm(0666 & ~mask);
250-
/*
251-
* We verify names via `refs_verify_refname_available()`, so there is
252-
* no need to do the same checks in the reftable library again.
253-
*/
254-
refs->write_options.skip_name_check = 1;
255250

256251
/*
257252
* Set up the main reftable stack that is hosted in GIT_COMMON_DIR.

reftable/error.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ const char *reftable_error_str(int err)
2727
return "misuse of the reftable API";
2828
case REFTABLE_ZLIB_ERROR:
2929
return "zlib failure";
30-
case REFTABLE_NAME_CONFLICT:
31-
return "file/directory conflict";
3230
case REFTABLE_EMPTY_TABLE_ERROR:
3331
return "wrote empty table";
3432
case REFTABLE_REFNAME_ERROR:

reftable/refname.c

Lines changed: 0 additions & 209 deletions
This file was deleted.

reftable/refname.h

Lines changed: 0 additions & 29 deletions
This file was deleted.

reftable/refname_test.c

Lines changed: 0 additions & 101 deletions
This file was deleted.

reftable/reftable-error.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ enum reftable_error {
4848
/* Wrote a table without blocks. */
4949
REFTABLE_EMPTY_TABLE_ERROR = -8,
5050

51-
/* Dir/file conflict. */
52-
REFTABLE_NAME_CONFLICT = -9,
53-
5451
/* Invalid ref name. */
5552
REFTABLE_REFNAME_ERROR = -10,
5653

reftable/reftable-tests.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ int block_test_main(int argc, const char **argv);
1414
int merged_test_main(int argc, const char **argv);
1515
int pq_test_main(int argc, const char **argv);
1616
int record_test_main(int argc, const char **argv);
17-
int refname_test_main(int argc, const char **argv);
1817
int readwrite_test_main(int argc, const char **argv);
1918
int stack_test_main(int argc, const char **argv);
2019
int tree_test_main(int argc, const char **argv);

0 commit comments

Comments
 (0)