Re: [RFH] lifetime rule for url parameter to transport_get()?
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 23, 2011, 16:50 UTC
- Message-ID
- <7vsjosrs0w.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <7vipppt175.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 6 quoted lines
> Does anybody remember why we use a copied string of "ref_git_copy" in > builtin/clone.c::setup_reference()? > > ref_git = real_path(option_reference); > ... > ref_git_copy = xstrdup(ref_git);
It didn't have anything to do with transport/remote layer.
This codepath uses real_path() and optionally mkpath(), both of which returns a short-lived static buffer to return its findings, and long-term users are expected to copy it away.
I'll add a comment to that effect in the code.