summaryrefslogtreecommitdiff
path: root/gitweb/static
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2014-07-25 17:43:57 +0700
committerJunio C Hamano <gitster@pobox.com>2014-07-30 12:53:09 -0700
commit0ad2607191d5173f460751a5cdb4ec51ea1c16e1 (patch)
tree2b3da4559f9d0fe1a244c9b772b0313b633f36c0 /gitweb/static
parent2373dc6b2f1442177bbbf7923e41e69da0d685e2 (diff)
downloadgit-0ad2607191d5173f460751a5cdb4ec51ea1c16e1.tar.gz
refs.c: refactor resolve_ref_unsafe() to use strbuf internally
In the beginning, we had resolve_ref() that returns a buffer owned by this function. Then we started to move away from that direction because the buffer could be overwritten by the next resolve_ref() call and introduced two new functions: resolve_ref_unsafe() and resolve_refdup(). The static buffer is still kept internally. This patch makes the core of resolve_ref use a strbuf instead of static buffer. Which makes resolve_refdup() more efficient (no need to copy from the static buffer to a new buffer). It also removes the (random?) 256 char limit. In future, resolve_ref() could be used directly without going through resolve_refdup() wrapper. A minor bonus. resolve_ref(dup) are now more thread-friendly (although I'm not 100% sure if they are thread-safe yet). 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 'gitweb/static')
0 files changed, 0 insertions, 0 deletions