X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=clone-pack.c;h=b5ce5d3111521427cffb8cf72c6acf31340255d9;hb=ee34518d629331dadd58b1a75294369d679eda8b;hp=4f4975b4ab7faecb172482f308999e48ea643d37;hpb=bfadbeddd1b54af8ab08a6c556c43c756ec85588;p=git.git diff --git a/clone-pack.c b/clone-pack.c index 4f4975b4..b5ce5d31 100644 --- a/clone-pack.c +++ b/clone-pack.c @@ -211,7 +211,7 @@ static int clone_without_unpack(int fd[2]) ifd = fd[0]; snprintf(tmpfile, sizeof(tmpfile), - "%s/pack-XXXXXX", get_object_directory()); + "%s/pack/tmp-XXXXXX", get_object_directory()); ofd = mkstemp(tmpfile); if (ofd < 0) return error("unable to create temporary file %s", tmpfile); @@ -259,8 +259,17 @@ static int clone_pack(int fd[2], int nr_match, char **match) status = clone_without_unpack(fd); - if (!status) - write_refs(refs); + if (!status) { + if (nr_match == 0) + write_refs(refs); + else + while (refs) { + printf("%s %s\n", + sha1_to_hex(refs->old_sha1), + refs->name); + refs = refs->next; + } + } return status; } @@ -271,6 +280,8 @@ int main(int argc, char **argv) int fd[2]; pid_t pid; + setup_git_directory(); + nr_heads = 0; heads = NULL; for (i = 1; i < argc; i++) {