{"thread":{"id":"14646","subject":"[PATCH]","startedAt":"2008-07-24T00:22:58Z","lastAt":"2008-07-24T00:58:45Z","messageCount":2,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"84656","messageId":"7vej5k8719.fsf@gitster.siamese.dyndns.org","threadId":"14646","inReplyTo":null,"subject":"[PATCH]","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-24T00:22:58Z","receivedAt":"2008-07-24T00:22:58Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"f2eba66 (Enable HEAD@{...} and make it independent from the current\nbranch, 2007-02-03) introduced dwim_log() to handle <refname>@{...}\nsyntax, and as part of its processing, it checks if the ref exists by\ncalling refsolve_ref().  It should call it as a reader to make sure the\ncall returns NULL for a nonexistent ref (not as a potential writer in\nwhich case it does not return NULL).\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\n * I found this purely by accident.  \"echo >.git/logs/refs/heads/HEAD\"\n   would make your \"git rev-parse HEAD@{1}\" complain about a refname\n   'HEAD' being ambiguous without this patch.\n\n sha1_name.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/sha1_name.c b/sha1_name.c\nindex b0b2167..4fb77f8 100644\n--- a/sha1_name.c\n+++ b/sha1_name.c\n@@ -273,7 +273,7 @@ int dwim_log(const char *str, int len, unsigned char *sha1, char **log)\n \t\tconst char *ref, *it;\n \n \t\tstrcpy(path, mkpath(*p, len, str));\n-\t\tref = resolve_ref(path, hash, 0, NULL);\n+\t\tref = resolve_ref(path, hash, 1, NULL);\n \t\tif (!ref)\n \t\t\tcontinue;\n \t\tif (!stat(git_path(\"logs/%s\", path), &st) &&\n"},{"id":"84659","messageId":"7v63qw85dm.fsf@gitster.siamese.dyndns.org","threadId":"14646","inReplyTo":"7vej5k8719.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] (unnamed)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-24T00:58:45Z","receivedAt":"2008-07-24T00:58:45Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ooops.\n\nI sent out before I can decide what the title should be.  Sorry, will\nthink of something.\n"}]}