提交 7d76fdc8 编写于 作者: M Michael Haggerty 提交者: Junio C Hamano

refs: document how current_ref is used

Signed-off-by: NMichael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 fcce1703
......@@ -529,6 +529,15 @@ static void sort_ref_dir(struct ref_dir *dir)
/* Include broken references in a do_for_each_ref*() iteration: */
#define DO_FOR_EACH_INCLUDE_BROKEN 0x01
/*
* current_ref is a performance hack: when iterating over references
* using the for_each_ref*() functions, current_ref is set to the
* current reference's entry before calling the callback function. If
* the callback function calls peel_ref(), then peel_ref() first
* checks whether the reference to be peeled is the current reference
* (it usually is) and if so, returns that reference's peeled version
* if it is available. This avoids a refname lookup in a common case.
*/
static struct ref_entry *current_ref;
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册