Skip to content

Commit cc6f663

Browse files
pcloudsgitster
authored andcommitted
t/helper: merge test-index-version into test-tool
Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7c18cbd commit cc6f663

File tree

7 files changed

+10
-7
lines changed

7 files changed

+10
-7
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,13 +663,13 @@ TEST_BUILTINS_OBJS += test-dump-split-index.o
663663
TEST_BUILTINS_OBJS += test-example-decorate.o
664664
TEST_BUILTINS_OBJS += test-genrandom.o
665665
TEST_BUILTINS_OBJS += test-hashmap.o
666+
TEST_BUILTINS_OBJS += test-index-version.o
666667
TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o
667668
TEST_BUILTINS_OBJS += test-sha1.o
668669

669670
TEST_PROGRAMS_NEED_X += test-dump-fsmonitor
670671
TEST_PROGRAMS_NEED_X += test-dump-untracked-cache
671672
TEST_PROGRAMS_NEED_X += test-fake-ssh
672-
TEST_PROGRAMS_NEED_X += test-index-version
673673
TEST_PROGRAMS_NEED_X += test-line-buffer
674674
TEST_PROGRAMS_NEED_X += test-match-trees
675675
TEST_PROGRAMS_NEED_X += test-mergesort

t/helper/test-index-version.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
#include "test-tool.h"
12
#include "cache.h"
23

3-
int cmd_main(int argc, const char **argv)
4+
int cmd__index_version(int argc, const char **argv)
45
{
56
struct cache_header hdr;
67
int version;

t/helper/test-tool.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ static struct test_cmd cmds[] = {
1818
{ "example-decorate", cmd__example_decorate },
1919
{ "genrandom", cmd__genrandom },
2020
{ "hashmap", cmd__hashmap },
21+
{ "index-version", cmd__index_version },
2122
{ "lazy-init-name-hash", cmd__lazy_init_name_hash },
2223
{ "sha1", cmd__sha1 },
2324
};

t/helper/test-tool.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ int cmd__dump_split_index(int argc, const char **argv);
1212
int cmd__example_decorate(int argc, const char **argv);
1313
int cmd__genrandom(int argc, const char **argv);
1414
int cmd__hashmap(int argc, const char **argv);
15+
int cmd__index_version(int argc, const char **argv);
1516
int cmd__lazy_init_name_hash(int argc, const char **argv);
1617
int cmd__sha1(int argc, const char **argv);
1718

t/t1600-index.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ test_expect_success 'GIT_INDEX_VERSION takes precedence over config' '
6868
git config --add index.version 2 &&
6969
git add a 2>&1 &&
7070
echo 4 >expect &&
71-
test-index-version <.git/index >actual &&
71+
test-tool index-version <.git/index >actual &&
7272
test_cmp expect actual
7373
)
7474
'

t/t1700-split-index.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ test_expect_success 'enable split index' '
1212
git config splitIndex.maxPercentChange 100 &&
1313
git update-index --split-index &&
1414
test-tool dump-split-index .git/index >actual &&
15-
indexversion=$(test-index-version <.git/index) &&
15+
indexversion=$(test-tool index-version <.git/index) &&
1616
if test "$indexversion" = "4"
1717
then
1818
own=432ef4b63f32193984f339431fd50ca796493569

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ test_expect_success 'setup' '
3333
'
3434

3535
test_expect_success 'index is at version 2' '
36-
test "$(test-index-version < .git/index)" = 2
36+
test "$(test-tool index-version < .git/index)" = 2
3737
'
3838

3939
test_expect_success 'update-index --skip-worktree' '
@@ -42,7 +42,7 @@ test_expect_success 'update-index --skip-worktree' '
4242
'
4343

4444
test_expect_success 'index is at version 3 after having some skip-worktree entries' '
45-
test "$(test-index-version < .git/index)" = 3
45+
test "$(test-tool index-version < .git/index)" = 3
4646
'
4747

4848
test_expect_success 'ls-files -t' '
@@ -55,7 +55,7 @@ test_expect_success 'update-index --no-skip-worktree' '
5555
'
5656

5757
test_expect_success 'index version is back to 2 when there is no skip-worktree entry' '
58-
test "$(test-index-version < .git/index)" = 2
58+
test "$(test-tool index-version < .git/index)" = 2
5959
'
6060

6161
test_done

0 commit comments

Comments
 (0)