branch.c: delete size check of newly tracked branch names
authorJacopo Notarstefano <jacopo.notarstefano@gmail.com>
Fri, 28 Feb 2014 11:09:04 +0000 (12:09 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 5 Mar 2014 20:26:51 +0000 (12:26 -0800)
Since commit 6f084a56 the length of a newly tracked branch name was limited
to 1019 = 1024 - 7 - 7 - 1 characters, a bound derived by having to store
this name in a char[1024] called key with two strings of length at most 7
and a '\0' character.

This was no longer necessary as of commit a9f2c136, which uses a strbuf
(documented in Documentation/technical/api-strbuf.txt) to store this value.

Remove this unneeded check to allow branch names longer than 1019
characters.

Signed-off-by: Jacopo Notarstefano <jacopo.notarstefano@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
branch.c
index 2d15c19e3e8d5d2ae317d0cb0e06a35ea8f5745e..19571b598f33aab0b3ae1cee28bfa7fcf8edfa33 100644 (file)
--- a/branch.c
+++ b/branch.c
@@ -114,10 +114,6 @@ static int setup_tracking(const char *new_ref, const char *orig_ref,
        struct tracking tracking;
        int config_flags = quiet ? 0 : BRANCH_CONFIG_VERBOSE;
 
-       if (strlen(new_ref) > 1024 - 7 - 7 - 1)
-               return error(_("Tracking not set up: name too long: %s"),
-                               new_ref);
-
        memset(&tracking, 0, sizeof(tracking));
        tracking.spec.dst = (char *)orig_ref;
        if (for_each_remote(find_tracked_branch, &tracking))