From: Junio C Hamano Date: Sun, 29 Jan 2012 21:18:53 +0000 (-0800) Subject: Merge branch 'mh/ref-clone-without-extra-refs' X-Git-Tag: v1.7.10-rc0~141 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a734e7ef6c14d8eb476fe8b2d6f861b3ed2c211d;p=git.git Merge branch 'mh/ref-clone-without-extra-refs' * mh/ref-clone-without-extra-refs: write_remote_refs(): create packed (rather than extra) refs add_packed_ref(): new function in the refs API. ref_array: keep track of whether references are sorted pack_refs(): remove redundant check --- a734e7ef6c14d8eb476fe8b2d6f861b3ed2c211d diff --cc builtin/clone.c index 9dcc5fe77,9413537a8..9084febb1 --- a/builtin/clone.c +++ b/builtin/clone.c @@@ -468,24 -445,8 +468,23 @@@ static void write_remote_refs(const str } pack_refs(PACK_REFS_ALL); - clear_extra_refs(); } +static void write_followtags(const struct ref *refs, const char *msg) +{ + const struct ref *ref; + for (ref = refs; ref; ref = ref->next) { + if (prefixcmp(ref->name, "refs/tags/")) + continue; + if (!suffixcmp(ref->name, "^{}")) + continue; + if (!has_sha1_file(ref->old_sha1)) + continue; + update_ref(msg, ref->name, ref->old_sha1, + NULL, 0, DIE_ON_ERR); + } +} + static int write_one_config(const char *key, const char *value, void *data) { return git_config_set_multivar(key, value ? value : "true", "^$", 0);