get_superproject_working_tree(): return strbuf
Together with the previous commits, this commit fully fixes the problem of using shared buffer for `real_path()` in `get_superproject_working_tree()`. Signed-off-by: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
4530a85b4c
commit
49d3c4b481
@ -808,9 +808,10 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
|
||||
continue;
|
||||
}
|
||||
if (!strcmp(arg, "--show-superproject-working-tree")) {
|
||||
const char *superproject = get_superproject_working_tree();
|
||||
if (superproject)
|
||||
puts(superproject);
|
||||
struct strbuf superproject = STRBUF_INIT;
|
||||
if (get_superproject_working_tree(&superproject))
|
||||
puts(superproject.buf);
|
||||
strbuf_release(&superproject);
|
||||
continue;
|
||||
}
|
||||
if (!strcmp(arg, "--show-prefix")) {
|
||||
|
Reference in New Issue
Block a user