The following thread: http://thread.gmane.org/gmane.comp.version-control.git/42469 (the message ID from the first message is: 20070318020645.2444.75365.julian@xxxxxxxxxxxxxxxxx) explains why "resolve_ref" is used with a "reading" parameter set to 0 instead of 1, but there was no comment saying that near the code. Signed-off-by: Christian Couder <chriscool@xxxxxxxxxxxxx> --- builtin-symbolic-ref.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) This comment may save other people some time. diff --git a/builtin-symbolic-ref.c b/builtin-symbolic-ref.c index bfc78bb..9490c47 100644 --- a/builtin-symbolic-ref.c +++ b/builtin-symbolic-ref.c @@ -12,6 +12,16 @@ static void check_symref(const char *HEAD, int quiet) { unsigned char sha1[20]; int flag; + + /* + * It doesn't seem logical to use "resolve_ref" with reading == 0 + * as we are just checking if a ref exists, but some code depends + * on the following to work: + * + * $ git init-db + * $ git symbolic-ref HEAD + * refs/heads/master + */ const char *refs_heads_master = resolve_ref(HEAD, sha1, 0, &flag); if (!refs_heads_master) -- 1.6.0.1.338.g5e95.dirty -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html