http-fetch: remove path_len from struct alt_base, it was computed but never used
Signed-off-by: Gerrit Pape <pape@smarden.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
parent
2afea3bcd2
commit
9c880b3ea5
20
http-fetch.c
20
http-fetch.c
@ -17,7 +17,6 @@ static struct curl_slist *no_pragma_header;
|
|||||||
struct alt_base
|
struct alt_base
|
||||||
{
|
{
|
||||||
char *base;
|
char *base;
|
||||||
int path_len;
|
|
||||||
int got_indices;
|
int got_indices;
|
||||||
struct packed_git *packs;
|
struct packed_git *packs;
|
||||||
struct alt_base *next;
|
struct alt_base *next;
|
||||||
@ -515,7 +514,6 @@ static void process_alternates_response(void *callback_data)
|
|||||||
int serverlen = 0;
|
int serverlen = 0;
|
||||||
struct alt_base *newalt;
|
struct alt_base *newalt;
|
||||||
char *target = NULL;
|
char *target = NULL;
|
||||||
char *path;
|
|
||||||
if (data[i] == '/') {
|
if (data[i] == '/') {
|
||||||
/* This counts
|
/* This counts
|
||||||
* http://git.host/pub/scm/linux.git/
|
* http://git.host/pub/scm/linux.git/
|
||||||
@ -583,12 +581,6 @@ static void process_alternates_response(void *callback_data)
|
|||||||
newalt->base = target;
|
newalt->base = target;
|
||||||
newalt->got_indices = 0;
|
newalt->got_indices = 0;
|
||||||
newalt->packs = NULL;
|
newalt->packs = NULL;
|
||||||
path = strstr(target, "//");
|
|
||||||
if (path) {
|
|
||||||
path = strchr(path+2, '/');
|
|
||||||
if (path)
|
|
||||||
newalt->path_len = strlen(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
while (tail->next != NULL)
|
while (tail->next != NULL)
|
||||||
tail = tail->next;
|
tail = tail->next;
|
||||||
@ -999,7 +991,7 @@ int main(int argc, const char **argv)
|
|||||||
const char **write_ref = NULL;
|
const char **write_ref = NULL;
|
||||||
char **commit_id;
|
char **commit_id;
|
||||||
const char *url;
|
const char *url;
|
||||||
char *path;
|
char *s;
|
||||||
int arg = 1;
|
int arg = 1;
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
|
||||||
@ -1046,17 +1038,11 @@ int main(int argc, const char **argv)
|
|||||||
alt = xmalloc(sizeof(*alt));
|
alt = xmalloc(sizeof(*alt));
|
||||||
alt->base = xmalloc(strlen(url) + 1);
|
alt->base = xmalloc(strlen(url) + 1);
|
||||||
strcpy(alt->base, url);
|
strcpy(alt->base, url);
|
||||||
for (path = alt->base + strlen(alt->base) - 1; *path == '/'; --path)
|
for (s = alt->base + strlen(alt->base) - 1; *s == '/'; --s)
|
||||||
*path = 0;
|
*s = 0;
|
||||||
alt->got_indices = 0;
|
alt->got_indices = 0;
|
||||||
alt->packs = NULL;
|
alt->packs = NULL;
|
||||||
alt->next = NULL;
|
alt->next = NULL;
|
||||||
path = strstr(url, "//");
|
|
||||||
if (path) {
|
|
||||||
path = strchr(path+2, '/');
|
|
||||||
if (path)
|
|
||||||
alt->path_len = strlen(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pull(commits, commit_id, write_ref, url))
|
if (pull(commits, commit_id, write_ref, url))
|
||||||
rc = 1;
|
rc = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user