From 7c4be458b1c7ba81b0cc63d76a144261eb2395be Mon Sep 17 00:00:00 2001 From: Stefan Beller Date: Tue, 27 Dec 2016 09:50:13 -0800 Subject: worktree: initialize return value for submodule_uses_worktrees When the worktrees directory is empty, the `ret` will be returned uninitialized. Fix it by initializing the value. Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- worktree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'worktree.c') diff --git a/worktree.c b/worktree.c index d4606aa8c..828fd7a0a 100644 --- a/worktree.c +++ b/worktree.c @@ -387,7 +387,7 @@ int submodule_uses_worktrees(const char *path) struct strbuf sb = STRBUF_INIT; DIR *dir; struct dirent *d; - int ret; + int ret = 0; struct repository_format format; submodule_gitdir = git_pathdup_submodule(path, "%s", ""); -- cgit v1.2.1