git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] branch.c: delete size check of newly tracked branch names
@ 2014-03-04 21:29 Jacopo Notarstefano
  0 siblings, 0 replies; only message in thread
From: Jacopo Notarstefano @ 2014-03-04 21:29 UTC (permalink / raw)
  To: git; +Cc: Jacopo Notarstefano, mhagger, christian.couder, pclouds

Since commit 6f084a56 the length of a newly tracked branch name is limited
to 1009 = 1024 - 7 - 7 - 1 characters, a bound derived by having to store
this name in a char[1024] with two strings of length at most 7 and a '\0'
character.

This is 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 and thus allow for branch names longer than 1009
characters.

Signed-off-by: Jacopo Notarstefano <jacopo.notarstefano@gmail.com>
---
 branch.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/branch.c b/branch.c
index 723a36b..05feaff 100644
--- 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))
-- 
1.9.0.138.g2de3478

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-03-04 21:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-04 21:29 [PATCH v2] branch.c: delete size check of newly tracked branch names Jacopo Notarstefano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).