]> git.ipfire.org Git - thirdparty/git.git/commit - argv-array.h
argv-array: add detach function
authorJeff King <peff@peff.net>
Mon, 22 Feb 2016 22:44:15 +0000 (17:44 -0500)
committerJunio C Hamano <gitster@pobox.com>
Mon, 22 Feb 2016 22:50:32 +0000 (14:50 -0800)
commitb992657ed0e2720e20302b0ac8c210dff55950b2
treeda139d348ebf30385b1ff8ea758ba8befe0b44b1
parent3689539127f786f32ff04da374d37cc1f72fb918
argv-array: add detach function

The usual pattern for an argv array is to initialize it,
push in some strings, and then clear it when done. Very
occasionally, though, we must do other exotic things with
the memory, like freeing the list but keeping the strings.
Let's provide a detach function so that callers can make use
of our API to build up the array, and then take ownership of
it.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/technical/api-argv-array.txt
argv-array.c
argv-array.h