• Jeff King's avatar
    Revert "prompt: clean up strbuf usage" · e1c1a324
    Jeff King authored
    This reverts commit 31b49d9b.
    That commit taught do_askpass to hand ownership of our
    buffer back to the caller rather than simply return a
    pointer into our internal strbuf.  What it failed to notice,
    though, was that our internal strbuf is static, because we
    are trying to emulate the getpass() interface.
    By handing off ownership, we created a memory leak that
    cannot be solved. Sometimes git_prompt returns a static
    buffer from getpass() (or our smarter git_terminal_prompt
    wrapper), and sometimes it returns an allocated string from
    Signed-off-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
prompt.c 1.36 KB