From: Stefan Beller Date: Tue, 27 Dec 2016 17:50:13 GMT Subject: [PATCH] worktree: initialize return value for submodule_uses_worktrees Message-ID: <20161227175013.12747-1-sbeller@google.com> In-Reply-To: <7E1C7387-4F37-423F-803D-3B5690B49D40@gmail.com> When the worktrees directory is empty, the `ret` will be returned uninitialized. Fix it by initializing the value. Signed-off-by: Stefan Beller --- This goes on top of 1a248cf (origin/sb/submodule-embed-gitdir); ideally to be squashed, but as it is in next already, as a separate patch. Thanks, Stefan worktree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worktree.c b/worktree.c index d4606aa8cd..828fd7a0ad 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", ""); -- 2.11.0.rc2.50.g8bda6b2.dirty