X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=http-pull.c;h=cc62f85f48fd5fa1e2e09039846845c495fd084a;hb=d6db01075b65da2b8584a0450619390893aae103;hp=d877c4abe3ff7766d858bfeac5c9a0eaf1385b65;hpb=4250a5e5b1755e45153248217fe1d5550c972c8d;p=git.git diff --git a/http-pull.c b/http-pull.c index d877c4ab..cc62f85f 100644 --- a/http-pull.c +++ b/http-pull.c @@ -24,7 +24,7 @@ static int zret; static size_t fwrite_sha1_file(void *ptr, size_t eltsize, size_t nmemb, void *data) { - char expn[4096]; + unsigned char expn[4096]; size_t size = eltsize * nmemb; int posn = 0; do { @@ -49,14 +49,10 @@ int fetch(unsigned char *sha1) { char *hex = sha1_to_hex(sha1); char *filename = sha1_file_name(sha1); - char real_sha1[20]; + unsigned char real_sha1[20]; char *url; char *posn; - if (has_sha1_file(sha1)) { - return 0; - } - local = open(filename, O_WRONLY | O_CREAT | O_EXCL, 0666); if (local < 0) @@ -83,8 +79,6 @@ int fetch(unsigned char *sha1) curl_easy_setopt(curl, CURLOPT_URL, url); - /*printf("Getting %s\n", hex);*/ - if (curl_easy_perform(curl)) return error("Couldn't get %s for %s\n", url, hex); @@ -100,6 +94,7 @@ int fetch(unsigned char *sha1) return error("File %s has bad hash\n", hex); } + pull_say("got %s\n", hex); return 0; } @@ -118,11 +113,13 @@ int main(int argc, char **argv) get_all = 1; get_tree = 1; get_history = 1; + } else if (argv[arg][1] == 'v') { + get_verbosely = 1; } arg++; } if (argc < arg + 2) { - usage("http-pull [-c] [-t] [-a] commit-id url"); + usage("git-http-pull [-c] [-t] [-a] [-v] commit-id url"); return 1; } commit_id = argv[arg];