Skip to content

Commit 83708f8

Browse files
committed
test-tool: retire "index-version"
As "git update-index --show-index-version" can do the same thing, the 'index-version' subcommand in the test-tool lost its reason to exist. Remove it and replace its use with the end-user facing 'git update-index --show-index-version'. Helped-by: Linus Arver <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 606e088 commit 83708f8

File tree

7 files changed

+5
-23
lines changed

7 files changed

+5
-23
lines changed

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,6 @@ TEST_BUILTINS_OBJS += test-hash-speed.o
808808
TEST_BUILTINS_OBJS += test-hash.o
809809
TEST_BUILTINS_OBJS += test-hashmap.o
810810
TEST_BUILTINS_OBJS += test-hexdump.o
811-
TEST_BUILTINS_OBJS += test-index-version.o
812811
TEST_BUILTINS_OBJS += test-json-writer.o
813812
TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o
814813
TEST_BUILTINS_OBJS += test-match-trees.o

t/helper/test-index-version.c

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

t/helper/test-tool.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ static struct test_cmd cmds[] = {
3838
{ "hashmap", cmd__hashmap },
3939
{ "hash-speed", cmd__hash_speed },
4040
{ "hexdump", cmd__hexdump },
41-
{ "index-version", cmd__index_version },
4241
{ "json-writer", cmd__json_writer },
4342
{ "lazy-init-name-hash", cmd__lazy_init_name_hash },
4443
{ "match-trees", cmd__match_trees },

t/helper/test-tool.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ int cmd__getcwd(int argc, const char **argv);
3232
int cmd__hashmap(int argc, const char **argv);
3333
int cmd__hash_speed(int argc, const char **argv);
3434
int cmd__hexdump(int argc, const char **argv);
35-
int cmd__index_version(int argc, const char **argv);
3635
int cmd__json_writer(int argc, const char **argv);
3736
int cmd__lazy_init_name_hash(int argc, const char **argv);
3837
int cmd__match_trees(int argc, const char **argv);

t/t1600-index.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ test_index_version () {
118118
fi &&
119119
git add a &&
120120
echo $EXPECTED_OUTPUT_VERSION >expect &&
121-
test-tool index-version <.git/index >actual &&
121+
git update-index --show-index-version >actual &&
122122
test_cmp expect actual
123123
)
124124
}

t/t1700-split-index.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ test_expect_success 'enable split index' '
4343
git config splitIndex.maxPercentChange 100 &&
4444
git update-index --split-index &&
4545
test-tool dump-split-index .git/index >actual &&
46-
indexversion=$(test-tool index-version <.git/index) &&
46+
indexversion=$(git update-index --show-index-version) &&
4747
4848
# NEEDSWORK: Stop hard-coding checksums.
4949
if test "$indexversion" = "4"

t/t2104-update-index-skip-worktree.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ test_expect_success 'setup' '
3939
'
4040

4141
test_expect_success 'index is at version 2' '
42-
test "$(test-tool index-version < .git/index)" = 2
42+
test "$(git update-index --show-index-version)" = 2
4343
'
4444

4545
test_expect_success 'update-index --skip-worktree' '
@@ -48,7 +48,7 @@ test_expect_success 'update-index --skip-worktree' '
4848
'
4949

5050
test_expect_success 'index is at version 3 after having some skip-worktree entries' '
51-
test "$(test-tool index-version < .git/index)" = 3
51+
test "$(git update-index --show-index-version)" = 3
5252
'
5353

5454
test_expect_success 'ls-files -t' '
@@ -61,7 +61,7 @@ test_expect_success 'update-index --no-skip-worktree' '
6161
'
6262

6363
test_expect_success 'index version is back to 2 when there is no skip-worktree entry' '
64-
test "$(test-tool index-version < .git/index)" = 2
64+
test "$(git update-index --show-index-version)" = 2
6565
'
6666

6767
test_done

0 commit comments

Comments
 (0)