X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-fetch-pack.c;h=1ea704063928d77fe1048b1abde35e42fcfb20e4;hb=88bbda08d7b9503862a8fb8846d78c67825e5e3d;hp=c97a42739d23ac7ed90ae207e5a3770c388e66a7;hpb=380a7426794dcad369dd48519cd01d6e0246cde5;p=git.git diff --git a/builtin-fetch-pack.c b/builtin-fetch-pack.c index c97a42739..1ea704063 100644 --- a/builtin-fetch-pack.c +++ b/builtin-fetch-pack.c @@ -309,7 +309,8 @@ done: } flushes--; } - return retval; + /* it is no error to fetch into a completely empty repo */ + return count ? retval : 0; } static struct commit_list *complete; @@ -519,7 +520,8 @@ static int get_pack(int xd[2], char **pack_lockfile) if (read_pack_header(demux.out, &header)) die("protocol error: bad pack header"); - snprintf(hdr_arg, sizeof(hdr_arg), "--pack_header=%u,%u", + snprintf(hdr_arg, sizeof(hdr_arg), + "--pack_header=%"PRIu32",%"PRIu32, ntohl(header.hdr_version), ntohl(header.hdr_entries)); if (ntohl(header.hdr_entries) < unpack_limit) do_keep = 0; @@ -635,7 +637,7 @@ static int remove_duplicates(int nr_heads, char **heads) return dst; } -static int fetch_pack_config(const char *var, const char *value) +static int fetch_pack_config(const char *var, const char *value, void *cb) { if (strcmp(var, "fetch.unpacklimit") == 0) { fetch_unpack_limit = git_config_int(var, value); @@ -647,7 +649,7 @@ static int fetch_pack_config(const char *var, const char *value) return 0; } - return git_default_config(var, value); + return git_default_config(var, value, cb); } static struct lock_file lock; @@ -657,7 +659,7 @@ static void fetch_pack_setup(void) static int did_setup; if (did_setup) return; - git_config(fetch_pack_config); + git_config(fetch_pack_config, NULL); if (0 <= transfer_unpack_limit) unpack_limit = transfer_unpack_limit; else if (0 <= fetch_unpack_limit) @@ -820,5 +822,6 @@ struct ref *fetch_pack(struct fetch_pack_args *my_args, } } + reprepare_packed_git(); return ref_cpy; }