commit - 84f2fa52a3151061c9bf74376ecec64fc0950e71
commit + ccbf9d19437064659ee579ef2113991f20285138
blob - f47aa8e86d8768912715b400cf78789fd66db0b8
blob + 3cbb66ee9fc1896eb60b0fd1a69059d37655ae44
--- libexec/got-fetch-pack/got-fetch-pack.c
+++ libexec/got-fetch-pack/got-fetch-pack.c
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*
}
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;
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;
}
}
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;
}