threads / patch / 54155

patchbuiltin/init-db.c: fix a sparse warning

Subject: [PATCH] builtin/init-db.c: fix a sparse warning

## tl;dr

2 messages between Aug 28, 2020 and Aug 28, 2020. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Ramsay Jones· Aug 28, 2020, 20:46 UTC · lore
Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
---
Hi Eric,

If you need to re-roll your 'es/worktree-repair' branch, could you please squash this into the relevant patch (commit 44a466ca7f (init: make --separate-git-dir work from within linked worktree, 27-08-2020)).

Thanks!

ATB, Ramsay Jones

 builtin/init-db.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Show changes to builtin/init-db.c +1 −1
diff --git a/builtin/init-db.c b/builtin/init-db.c
index 6a94d20a2e..cd3e760541 100644
--- a/builtin/init-db.c
+++ b/builtin/init-db.c
@@ -661,7 +661,7 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
 			if (chdir(mainwt.buf) < 0)
 				die_errno(_("cannot chdir to %s"), mainwt.buf);
 			strbuf_release(&mainwt);
-			git_dir = strbuf_detach(&sb, 0);
+			git_dir = strbuf_detach(&sb, NULL);
 		}
 		strbuf_release(&sb);
 	}
-- 
2.28.0
Eric Sunshine· Aug 28, 2020, 22:20 UTC · re: Ramsay Jones · lore

Re: [PATCH] builtin/init-db.c: fix a sparse warning

On Fri, Aug 28, 2020 at 4:47 PM Ramsay Jones <ramsay@ramsayjones.plus.com> wrote:

Show 6 quoted lines
> If you need to re-roll your 'es/worktree-repair' branch, could you
> please squash this into the relevant patch (commit 44a466ca7f (init:
> make --separate-git-dir work from within linked worktree, 27-08-2020)).
>
> -                       git_dir = strbuf_detach(&sb, 0);
> +                       git_dir = strbuf_detach(&sb, NULL);

Thanks. I misremembered the purpose of the second argument, thinking that it was a size hint which would be passed along to strbuf_init().

← back to recent threads