{"thread":{"id":"35212","subject":"[PATCH] sha1_file: move comment about return value where it belongs","startedAt":"2013-10-26T22:34:30Z","lastAt":"2013-10-28T20:19:43Z","messageCount":2,"participants":["Christian Couder","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"229579","messageId":"20131026223431.21409.92481.chriscool@tuxfamily.org","threadId":"35212","inReplyTo":null,"subject":"[PATCH] sha1_file: move comment about return value where it belongs","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2013-10-26T22:34:30Z","receivedAt":"2013-10-26T22:34:30Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Commit 5b0864070 (sha1_object_info_extended: make type calculation\noptional, Jul 12 2013) changed the return value of the\nsha1_object_info_extended function to 0/-1 for success/error.\n\nPreviously this function returned the object type for success or\n-1 for error. But unfortunately the above commit forgot to change\nor move the comment above this function that says \"returns enum\nobject_type or negative\".\n\nTo fix this inconsistency, let's move the comment above the\nsha1_object_info function where it is still true.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n sha1_file.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/sha1_file.c b/sha1_file.c\nindex f80bbe4..7dadd04 100644\n--- a/sha1_file.c\n+++ b/sha1_file.c\n@@ -2514,7 +2514,6 @@ static int sha1_loose_object_info(const unsigned char *sha1,\n \treturn 0;\n }\n \n-/* returns enum object_type or negative */\n int sha1_object_info_extended(const unsigned char *sha1, struct object_info *oi)\n {\n \tstruct cached_object *co;\n@@ -2563,6 +2562,7 @@ int sha1_object_info_extended(const unsigned char *sha1, struct object_info *oi)\n \treturn 0;\n }\n \n+/* returns enum object_type or negative */\n int sha1_object_info(const unsigned char *sha1, unsigned long *sizep)\n {\n \tenum object_type type;\n-- \n1.8.4.rc1.28.ge2684af\n"},{"id":"229666","messageId":"20131028201942.GA21891@sigill.intra.peff.net","threadId":"35212","inReplyTo":"20131026223431.21409.92481.chriscool@tuxfamily.org","subject":"Re: [PATCH] sha1_file: move comment about return value where it belongs","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-10-28T20:19:43Z","receivedAt":"2013-10-28T20:19:43Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Oct 27, 2013 at 12:34:30AM +0200, Christian Couder wrote:\n\n> Commit 5b0864070 (sha1_object_info_extended: make type calculation\n> optional, Jul 12 2013) changed the return value of the\n> sha1_object_info_extended function to 0/-1 for success/error.\n> \n> Previously this function returned the object type for success or\n> -1 for error. But unfortunately the above commit forgot to change\n> or move the comment above this function that says \"returns enum\n> object_type or negative\".\n> \n> To fix this inconsistency, let's move the comment above the\n> sha1_object_info function where it is still true.\n\nThanks for catching this. Your analysis and patch looks good to me.\n\n-Peff\n"}]}