| 4840 | } |
| 4841 | |
| 4842 | static const char *diff_abbrev_oid(const struct object_id *oid, int abbrev) |
| 4843 | { |
| 4844 | if (startup_info->have_repository) |
| 4845 | return repo_find_unique_abbrev(the_repository, oid, abbrev); |
| 4846 | else { |
| 4847 | char *hex = oid_to_hex(oid); |
| 4848 | if (abbrev < 0) |
| 4849 | abbrev = FALLBACK_DEFAULT_ABBREV; |
| 4850 | if (abbrev > the_hash_algo->hexsz) |
| 4851 | BUG("oid abbreviation out of range: %d", abbrev); |
| 4852 | if (abbrev) |
| 4853 | hex[abbrev] = '\0'; |
| 4854 | return hex; |
| 4855 | } |
| 4856 | } |
| 4857 | |
| 4858 | static void fill_metainfo(struct strbuf *msg, |
| 4859 | const char *name, |
no test coverage detected