Skip to content

Commit ff5fb8b

Browse files
pcloudsgitster
authored andcommitted
t/helper: merge test-scrap-cache-tree 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 ae6a51f commit ff5fb8b

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,7 @@ TEST_BUILTINS_OBJS += test-ref-store.o
676676
TEST_BUILTINS_OBJS += test-regex.o
677677
TEST_BUILTINS_OBJS += test-revision-walking.o
678678
TEST_BUILTINS_OBJS += test-run-command.o
679+
TEST_BUILTINS_OBJS += test-scrap-cache-tree.o
679680
TEST_BUILTINS_OBJS += test-sha1.o
680681

681682
TEST_PROGRAMS_NEED_X += test-dump-fsmonitor
@@ -684,7 +685,6 @@ TEST_PROGRAMS_NEED_X += test-fake-ssh
684685
TEST_PROGRAMS_NEED_X += test-line-buffer
685686
TEST_PROGRAMS_NEED_X += test-parse-options
686687
TEST_PROGRAMS_NEED_X += test-write-cache
687-
TEST_PROGRAMS_NEED_X += test-scrap-cache-tree
688688
TEST_PROGRAMS_NEED_X += test-sha1-array
689689
TEST_PROGRAMS_NEED_X += test-sigchain
690690
TEST_PROGRAMS_NEED_X += test-strcmp-offset

t/helper/test-scrap-cache-tree.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
#include "test-tool.h"
12
#include "cache.h"
23
#include "lockfile.h"
34
#include "tree.h"
45
#include "cache-tree.h"
56

67
static struct lock_file index_lock;
78

8-
int cmd_main(int ac, const char **av)
9+
int cmd__scrap_cache_tree(int ac, const char **av)
910
{
1011
setup_git_directory();
1112
hold_locked_index(&index_lock, LOCK_DIE_ON_ERROR);

t/helper/test-tool.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ static struct test_cmd cmds[] = {
3131
{ "regex", cmd__regex },
3232
{ "revision-walking", cmd__revision_walking },
3333
{ "run-command", cmd__run_command },
34+
{ "scrap-cache-tree", cmd__scrap_cache_tree },
3435
{ "sha1", cmd__sha1 },
3536
};
3637

t/helper/test-tool.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ int cmd__ref_store(int argc, const char **argv);
2525
int cmd__regex(int argc, const char **argv);
2626
int cmd__revision_walking(int argc, const char **argv);
2727
int cmd__run_command(int argc, const char **argv);
28+
int cmd__scrap_cache_tree(int argc, const char **argv);
2829
int cmd__sha1(int argc, const char **argv);
2930

3031
#endif

t/t0090-cache-tree.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,14 @@ test_expect_success 'update-index invalidates cache-tree' '
115115
'
116116

117117
test_expect_success 'write-tree establishes cache-tree' '
118-
test-scrap-cache-tree &&
118+
test-tool scrap-cache-tree &&
119119
git write-tree &&
120120
test_cache_tree
121121
'
122122

123-
test_expect_success 'test-scrap-cache-tree works' '
123+
test_expect_success 'test-tool scrap-cache-tree works' '
124124
git read-tree HEAD &&
125-
test-scrap-cache-tree &&
125+
test-tool scrap-cache-tree &&
126126
test_no_cache_tree
127127
'
128128

@@ -170,7 +170,7 @@ test_expect_success 'commit in child dir has cache-tree' '
170170
'
171171

172172
test_expect_success 'reset --hard gives cache-tree' '
173-
test-scrap-cache-tree &&
173+
test-tool scrap-cache-tree &&
174174
git reset --hard &&
175175
test_cache_tree
176176
'

0 commit comments

Comments
 (0)