X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=clone-pack.c;h=b5ce5d3111521427cffb8cf72c6acf31340255d9;hb=31ec6abf887ec95642cbe82fe61076e975494ab0;hp=960921903eaa712523af0b03098970127729f363;hpb=56fc63193975edd4b9f520b6c65c2b97ecd8ee38;p=git.git diff --git a/clone-pack.c b/clone-pack.c index 96092190..b5ce5d31 100644 --- a/clone-pack.c +++ b/clone-pack.c @@ -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++) {