Skip to content

Commit

Permalink
branch.c: delete size check of newly tracked branch names
Browse files Browse the repository at this point in the history
Since commit 6f084a5 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 a9f2c13, 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 <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
jacquerie authored and gitster committed Mar 5, 2014
1 parent 2f93541 commit 9ef5e2a
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions branch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 9ef5e2a

Please sign in to comment.