{"thread":{"id":"184","subject":"(rework) [PATCH 3/4] Accept commit in some places when tree is needed.","startedAt":"2005-04-21T00:23:00Z","lastAt":"2005-04-21T02:32:59Z","messageCount":4,"participants":["Junio C Hamano","Linus Torvalds"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"1069","messageId":"7vvf6hgeqj.fsf@assigned-by-dhcp.cox.net","threadId":"184","inReplyTo":null,"subject":"(rework) [PATCH 3/4] Accept commit in some places when tree is needed.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-04-21T00:23:00Z","receivedAt":"2005-04-21T00:23:00Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Updates ls-tree.c to use read_tree_with_tree_or_commit_sha1()\nfunction.  The command can take either tree or commit IDs with\nthis patch.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n\n ls-tree.c |   11 +++++------\n 1 files changed, 5 insertions(+), 6 deletions(-)\n\nls-tree.c: c063640c114634dc7cf950ce44863dd17ddf83c1\n--- a/ls-tree.c\n+++ b/ls-tree.c\n@@ -24,9 +24,9 @@ static void print_path_prefix(struct pat\n }\n \n static void list_recursive(void *buffer,\n-\t\t\t  unsigned char *type,\n-\t\t\t  unsigned long size,\n-\t\t\t  struct path_prefix *prefix)\n+\t\t\t   const unsigned char *type,\n+\t\t\t   unsigned long size,\n+\t\t\t   struct path_prefix *prefix)\n {\n \tstruct path_prefix this_prefix;\n \tthis_prefix.prev = prefix;\n@@ -72,12 +72,11 @@ static int list(unsigned char *sha1)\n {\n \tvoid *buffer;\n \tunsigned long size;\n-\tchar type[20];\n \n-\tbuffer = read_sha1_file(sha1, type, &size);\n+\tbuffer = read_tree_with_tree_or_commit_sha1(sha1, &size, 0);\n \tif (!buffer)\n \t\tdie(\"unable to read sha1 file\");\n-\tlist_recursive(buffer, type, size, NULL);\n+\tlist_recursive(buffer, \"tree\", size, NULL);\n \treturn 0;\n }\n\n"},{"id":"1072","messageId":"7vk6mxgds8.fsf@assigned-by-dhcp.cox.net","threadId":"184","inReplyTo":"7vvf6hgeqj.fsf@assigned-by-dhcp.cox.net","subject":"Re: (rework) [PATCH 3/4] Accept commit in some places when tree is needed.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-04-21T00:43:35Z","receivedAt":"2005-04-21T00:43:35Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":">>>>> \"JCH\" == Junio C Hamano <junkio@cox.net> writes:\n\nJCH> Updates ls-tree.c to use read_tree_with_tree_or_commit_sha1()\nJCH> function.  The command can take either tree or commit IDs with\nJCH> this patch.\n\nSorry, but the numbering is wrong this should have been [4/5]\nnot [3/4].  The contents should be fine, though.\n\n"},{"id":"1073","messageId":"Pine.LNX.4.58.0504201807320.2344@ppc970.osdl.org","threadId":"184","inReplyTo":"7vk6mxgds8.fsf@assigned-by-dhcp.cox.net","subject":"Re: (rework) [PATCH 3/4] Accept commit in some places when tree is needed.","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-04-21T01:09:05Z","receivedAt":"2005-04-21T01:09:05Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Wed, 20 Apr 2005, Junio C Hamano wrote:\n> \n> Sorry, but the numbering is wrong this should have been [4/5]\n> not [3/4].  The contents should be fine, though.\n\nApplied and pushed out.\n\nBtw, I edited your subject lines to make them be more specific\nto one particular patch.\n\n\t\tLinus\n"},{"id":"1079","messageId":"7v7jiwhnac.fsf@assigned-by-dhcp.cox.net","threadId":"184","inReplyTo":"Pine.LNX.4.58.0504201807320.2344@ppc970.osdl.org","subject":"Re: (rework) [PATCH 3/4] Accept commit in some places when tree is needed.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-04-21T02:32:59Z","receivedAt":"2005-04-21T02:32:59Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":">>>>> \"LT\" == Linus Torvalds <torvalds@osdl.org> writes:\n\nLT> On Wed, 20 Apr 2005, Junio C Hamano wrote:\n>> \n>> Sorry, but the numbering is wrong this should have been [4/5]\n>> not [3/4].  The contents should be fine, though.\n\nLT> Applied and pushed out.\n\nThanks.  I have alreay a bugfix and a half X-<.\n\n----------------------------------------------------------------\n[PATCH] Fix read-tree-with-tree-or-commit-sha1 function.\n\nInstead of NULL to signal an error, it was returning a garbage.\nAlso the compiler complains about a type mismatch between signed\nand unsigned character array.  Both are my bad.  Sorry.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net> \n---\n\n--- l/sha1_file.c\t2005-04-20 19:00:38.000000000 -0700\n+++ k/sha1_file.c\t2005-04-20 18:14:34.000000000 -0700\n@@ -174,7 +174,7 @@\n \tvoid *buffer;\n \tunsigned long isize;\n \tint was_commit = 0;\n-\tchar tree_sha1[20];\n+\tunsigned char tree_sha1[20];\n \n \tbuffer = read_sha1_file(sha1, type, &isize);\n \n@@ -197,7 +197,7 @@\n \t */\n \tif (!buffer || strcmp(type, \"tree\")) {\n \t\tfree(buffer);\n-\t\treturn;\n+\t\treturn NULL;\n \t}\n \n \t*size = isize;\n\n\n"}]}