test-repository: properly init repo

Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Derrick Stolee committed Aug 20, 2018 at 18:24 UTC b7758963424e238b9152f0c9991325ff7fdffff1
1 file changed +8 -2
t/helper/test-repository.c
+8 -2
@@ -15,7 +15,10 @@ static void test_parse_commit_in_graph(const char *gitdir, const char *worktree,
15 struct commit *c;
16 struct commit_list *parent;
17
18 - repo_init(&r, gitdir, worktree);
18 + setup_git_env(gitdir);
19 +
20 + if (repo_init(&r, gitdir, worktree))
21 + die("Couldn't init repo");
22
23 c = lookup_commit(&r, commit_oid);
24
@@ -38,7 +41,10 @@ static void test_get_commit_tree_in_graph(const char *gitdir,
41 struct commit *c;
42 struct tree *tree;
43
41 - repo_init(&r, gitdir, worktree);
44 + setup_git_env(gitdir);
45 +
46 + if (repo_init(&r, gitdir, worktree))
47 + die("Couldn't init repo");
48
49 c = lookup_commit(&r, commit_oid);
50