Merge branch 'jk/printf-format'

Code clean-up to avoid using a variable string that compilers may
feel untrustable as printf-style format given to write_file()
helper function.

* jk/printf-format:
  commit.c: remove print_commit_list()
  avoid using sha1_to_hex output as printf format
  walker: let walker_say take arbitrary formats
This commit is contained in:
Junio C Hamano
2016-07-19 13:22:22 -07:00
6 changed files with 14 additions and 20 deletions

View File

@ -1622,16 +1622,6 @@ struct commit_list **commit_list_append(struct commit *commit,
return &new->next;
}
void print_commit_list(struct commit_list *list,
const char *format_cur,
const char *format_last)
{
for ( ; list; list = list->next) {
const char *format = list->next ? format_cur : format_last;
printf(format, oid_to_hex(&list->item->object.oid));
}
}
const char *find_commit_header(const char *msg, const char *key, size_t *out_len)
{
int key_len = strlen(key);