{"thread":{"id":"36056","subject":"[PATCH v2] branch.c: delete size check of newly tracked branch names","startedAt":"2014-03-04T21:29:17Z","lastAt":"2014-03-04T21:29:17Z","messageCount":1,"participants":["Jacopo Notarstefano"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"236044","messageId":"1393968557-22696-1-git-send-email-jacopo.notarstefano@gmail.com","threadId":"36056","inReplyTo":null,"subject":"[PATCH v2] branch.c: delete size check of newly tracked branch names","fromName":"Jacopo Notarstefano","fromEmail":"jacopo.notarstefano@gmail.com","sentAt":"2014-03-04T21:29:17Z","receivedAt":"2014-03-04T21:29:17Z","isPatch":true,"sender":{"key":"jacopo.notarstefano@gmail.com","avatar":"https://avatars.githubusercontent.com/u/381280?v=4"},"body":"Since commit 6f084a56 the length of a newly tracked branch name is limited\nto 1009 = 1024 - 7 - 7 - 1 characters, a bound derived by having to store\nthis name in a char[1024] with two strings of length at most 7 and a '\\0'\ncharacter.\n\nThis is no longer necessary as of commit a9f2c136, which uses a strbuf\n(documented in Documentation/technical/api-strbuf.txt) to store this value.\n\nRemove this unneeded check and thus allow for branch names longer than 1009\ncharacters.\n\nSigned-off-by: Jacopo Notarstefano <jacopo.notarstefano@gmail.com>\n---\n branch.c | 4 ----\n 1 file changed, 4 deletions(-)\n\ndiff --git a/branch.c b/branch.c\nindex 723a36b..05feaff 100644\n--- a/branch.c\n+++ b/branch.c\n@@ -114,10 +114,6 @@ static int setup_tracking(const char *new_ref, const char *orig_ref,\n \tstruct tracking tracking;\n \tint config_flags = quiet ? 0 : BRANCH_CONFIG_VERBOSE;\n \n-\tif (strlen(new_ref) > 1024 - 7 - 7 - 1)\n-\t\treturn error(_(\"Tracking not set up: name too long: %s\"),\n-\t\t\t\tnew_ref);\n-\n \tmemset(&tracking, 0, sizeof(tracking));\n \ttracking.spec.dst = (char *)orig_ref;\n \tif (for_each_remote(find_tracked_branch, &tracking))\n-- \n1.9.0.138.g2de3478\n"}]}