Skip to content

Commit 7c4be45

Browse files
stefanbellergitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f6f8586 commit 7c4be45

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

worktree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ int submodule_uses_worktrees(const char *path)
387387
struct strbuf sb = STRBUF_INIT;
388388
DIR *dir;
389389
struct dirent *d;
390-
int ret;
390+
int ret = 0;
391391
struct repository_format format;
392392

393393
submodule_gitdir = git_pathdup_submodule(path, "%s", "");

0 commit comments

Comments
 (0)