t/helper: merge test-index-version into test-tool
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy committed
Mar 24, 2018 at 08:44 UTC
cc6f663dea6d146dcf8b9fa75c101ecb0e41a5c6
7 files changed
+10
-7
Makefile
+1
-1
@@ -663,13 +663,13 @@ TEST_BUILTINS_OBJS += test-dump-split-index.o
663
TEST_BUILTINS_OBJS += test-example-decorate.o
664
TEST_BUILTINS_OBJS += test-genrandom.o
665
TEST_BUILTINS_OBJS += test-hashmap.o
666
+TEST_BUILTINS_OBJS += test-index-version.o
667
TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o
668
TEST_BUILTINS_OBJS += test-sha1.o
669
670
TEST_PROGRAMS_NEED_X += test-dump-fsmonitor
671
TEST_PROGRAMS_NEED_X += test-dump-untracked-cache
672
TEST_PROGRAMS_NEED_X += test-fake-ssh
672
-TEST_PROGRAMS_NEED_X += test-index-version
673
TEST_PROGRAMS_NEED_X += test-line-buffer
674
TEST_PROGRAMS_NEED_X += test-match-trees
675
TEST_PROGRAMS_NEED_X += test-mergesort
t/helper/test-index-version.c
+2
-1
@@ -1,6 +1,7 @@
1
+#include "test-tool.h"
2
#include "cache.h"
3
3
-int cmd_main(int argc, const char **argv)
4
+int cmd__index_version(int argc, const char **argv)
5
{
6
struct cache_header hdr;
7
int version;
t/helper/test-tool.c
+1
@@ -18,6 +18,7 @@ static struct test_cmd cmds[] = {
18
{ "example-decorate", cmd__example_decorate },
19
{ "genrandom", cmd__genrandom },
20
{ "hashmap", cmd__hashmap },
21
+ { "index-version", cmd__index_version },
22
{ "lazy-init-name-hash", cmd__lazy_init_name_hash },
23
{ "sha1", cmd__sha1 },
24
};
t/helper/test-tool.h
+1
@@ -12,6 +12,7 @@ int cmd__dump_split_index(int argc, const char **argv);
12
int cmd__example_decorate(int argc, const char **argv);
13
int cmd__genrandom(int argc, const char **argv);
14
int cmd__hashmap(int argc, const char **argv);
15
+int cmd__index_version(int argc, const char **argv);
16
int cmd__lazy_init_name_hash(int argc, const char **argv);
17
int cmd__sha1(int argc, const char **argv);
18
t/t1600-index.sh
+1
-1
@@ -68,7 +68,7 @@ test_expect_success 'GIT_INDEX_VERSION takes precedence over config' '
68
git config --add index.version 2 &&
69
git add a 2>&1 &&
70
echo 4 >expect &&
71
- test-index-version <.git/index >actual &&
71
+ test-tool index-version <.git/index >actual &&
72
test_cmp expect actual
73
)
74
'
t/t1700-split-index.sh
+1
-1
@@ -12,7 +12,7 @@ test_expect_success 'enable split index' '
12
git config splitIndex.maxPercentChange 100 &&
13
git update-index --split-index &&
14
test-tool dump-split-index .git/index >actual &&
15
- indexversion=$(test-index-version <.git/index) &&
15
+ indexversion=$(test-tool index-version <.git/index) &&
16
if test "$indexversion" = "4"
17
then
18
own=432ef4b63f32193984f339431fd50ca796493569
t/t2104-update-index-skip-worktree.sh
+3
-3
@@ -33,7 +33,7 @@ test_expect_success 'setup' '
33
'
34
35
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
37
'
38
39
test_expect_success 'update-index --skip-worktree' '
@@ -42,7 +42,7 @@ test_expect_success 'update-index --skip-worktree' '
42
'
43
44
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
46
'
47
48
test_expect_success 'ls-files -t' '
@@ -55,7 +55,7 @@ test_expect_success 'update-index --no-skip-worktree' '
55
'
56
57
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
59
'
60
61
test_done