X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=http-fetch.c;h=d3602b7d7d820a37b6395a7aeb96a8dc8368a646;hb=7a97de4e19757b5576f32ce67d90cb792dbb893b;hp=71a7dafd696d0da3a9662fb19cd83f87df1ec9b4;hpb=1b83ace35e7869ad77810ab68984b1bf2b8c7038;p=git.git diff --git a/http-fetch.c b/http-fetch.c index 71a7dafd..d3602b7d 100644 --- a/http-fetch.c +++ b/http-fetch.c @@ -399,6 +399,7 @@ void prefetch(unsigned char *sha1) snprintf(newreq->filename, sizeof(newreq->filename), "%s", filename); snprintf(newreq->tmpfile, sizeof(newreq->tmpfile), "%s.temp", filename); + newreq->slot = NULL; newreq->next = NULL; if (object_queue_head == NULL) { @@ -597,7 +598,7 @@ static void process_alternates_response(void *callback_data) newalt->packs = NULL; path = strstr(target, "//"); if (path) { - path = index(path+2, '/'); + path = strchr(path+2, '/'); if (path) newalt->path_len = strlen(path); } @@ -678,7 +679,7 @@ static void xml_start_tag(void *userData, const char *name, const char **atts) { struct xml_ctx *ctx = (struct xml_ctx *)userData; - const char *c = index(name, ':'); + const char *c = strchr(name, ':'); int new_len; if (c == NULL) @@ -707,7 +708,7 @@ static void xml_end_tag(void *userData, const char *name) { struct xml_ctx *ctx = (struct xml_ctx *)userData; - const char *c = index(name, ':'); + const char *c = strchr(name, ':'); char *ep; ctx->userFunc(ctx, 1); @@ -1223,6 +1224,7 @@ int main(int argc, char **argv) int rc = 0; setup_git_directory(); + git_config(git_default_config); while (arg < argc && argv[arg][0] == '-') { if (argv[arg][1] == 't') { @@ -1249,6 +1251,7 @@ int main(int argc, char **argv) } commit_id = argv[arg]; url = argv[arg + 1]; + write_ref_log_details = url; http_init(); @@ -1261,7 +1264,7 @@ int main(int argc, char **argv) alt->next = NULL; path = strstr(url, "//"); if (path) { - path = index(path+2, '/'); + path = strchr(path+2, '/'); if (path) alt->path_len = strlen(path); } @@ -1269,10 +1272,10 @@ int main(int argc, char **argv) if (pull(commit_id)) rc = 1; - curl_slist_free_all(no_pragma_header); - http_cleanup(); + curl_slist_free_all(no_pragma_header); + if (corrupt_object_found) { fprintf(stderr, "Some loose object were found to be corrupt, but they might be just\n"