Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2013-03-16 06:12:36 +0400
committerJunio C Hamano <gitster@pobox.com>2013-03-17 09:10:32 +0400
commit8b87cfd000c7c98f58279cff698f6e8c7892c059 (patch)
tree377bf80b612912dca6462e9b10ec06f7dd0a2651 /version.c
parentcdd76db373c23bbd637c76a605b3e7f571500103 (diff)
wt-status: move strbuf into read_and_strip_branch()
The strbufs are placed outside read_and_strip_branch as a premature optimization: when it reads "refs/heads/foo" to strbuf and wants to return just "foo", it could do so without memory movement. In return the caller must not use the returned pointer after releasing strbufs, which own the buffers that contain the returned strings. It's a clumsy design. By moving strbufs into read_and_strip_branch(), the returned pointer always points to a malloc'd buffer or NULL. The pointer can be passed around and freed after use. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'version.c')
0 files changed, 0 insertions, 0 deletions