Skip to content

Commit aee7700

Browse files
pks-tttaylorr
authored andcommitted
t/helper: stop re-initialization of the_repository
While "common-main.c" already initializes `the_repository` for us, we do so a second time in the "read-cache" test helper. This causes a memory leak because the old repository's contents isn't released. Stop calling `initialize_repository()` to plug this leak. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Taylor Blau <[email protected]>
1 parent 047c724 commit aee7700

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

t/helper/test-read-cache.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ int cmd__read_cache(int argc, const char **argv)
1111
int i, cnt = 1;
1212
const char *name = NULL;
1313

14-
initialize_repository(the_repository);
15-
1614
if (argc > 1 && skip_prefix(argv[1], "--print-and-refresh=", &name)) {
1715
argc--;
1816
argv++;

t/t7519-status-fsmonitor.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
test_description='git status with file system watcher'
44

5+
TEST_PASSES_SANITIZE_LEAK=true
56
. ./test-lib.sh
67

78
# Note, after "git reset --hard HEAD" no extensions exist other than 'TREE'

0 commit comments

Comments
 (0)