commit ccbf9d19437064659ee579ef2113991f20285138 from: Stefan Sperling date: Wed Mar 18 16:10:32 2020 UTC remove some unused path variables from got-fetch-pack commit - 84f2fa52a3151061c9bf74376ecec64fc0950e71 commit + ccbf9d19437064659ee579ef2113991f20285138 blob - f47aa8e86d8768912715b400cf78789fd66db0b8 blob + 3cbb66ee9fc1896eb60b0fd1a69059d37655ae44 --- libexec/got-fetch-pack/got-fetch-pack.c +++ libexec/got-fetch-pack/got-fetch-pack.c @@ -51,7 +51,6 @@ struct got_object *indexed; static int chattygit; static char *fetchbranch; static char *upstream = "origin"; -static char *packtmp = ".git/objects/pack/fetch.tmp"; static struct got_object_id zhash = {.sha1={0}}; static char* @@ -283,9 +282,9 @@ got_tokenize_refline(char *line, char **sp, size_t nsp } static int -got_fetch_pack(int fd, int packfd, char *packtmp, struct got_object_id *packid) +got_fetch_pack(int fd, int packfd, struct got_object_id *packid) { - char buf[GOT_PKTMAX], idxtmp[256], *sp[3]; + char buf[GOT_PKTMAX], *sp[3]; char hashstr[SHA1_DIGEST_STRING_LENGTH]; struct got_object_id *have, *want; int nref, refsz; @@ -391,9 +390,6 @@ got_fetch_pack(int fd, int packfd, char *packtmp, stru if(got_check_pack_hash(packfd, packsz, packid->sha1) == -1) errx(1, "corrupt packfile"); close(packfd); - n = strlen(packtmp) - strlen(".tmp"); - memcpy(idxtmp, packtmp, n); - memcpy(idxtmp + n, ".idx", strlen(".idx") + 1); return 0; } @@ -447,7 +443,7 @@ main(int argc, char **argv) } packfd = imsg.fd; - if(got_fetch_pack(fetchfd, packfd, packtmp, &packid) == -1) { + if (got_fetch_pack(fetchfd, packfd, &packid) == -1) { err = got_error(GOT_ERR_FETCH_FAILED); goto done; }