MCPcopy Index your code
hub / github.com/git/git / record_author_date

Function record_author_date

commit.c:866–891  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

864define_commit_slab(author_date_slab, timestamp_t);
865
866void record_author_date(struct author_date_slab *author_date,
867 struct commit *commit)
868{
869 const char *buffer = repo_get_commit_buffer(the_repository, commit,
870 NULL);
871 struct ident_split ident;
872 const char *ident_line;
873 size_t ident_len;
874 char *date_end;
875 timestamp_t date;
876
877 ident_line = find_commit_header(buffer, "author", &ident_len);
878 if (!ident_line)
879 goto fail_exit; /* no author line */
880 if (split_ident_line(&ident, ident_line, ident_len) ||
881 !ident.date_begin || !ident.date_end)
882 goto fail_exit; /* malformed "author" line */
883
884 date = parse_timestamp(ident.date_begin, &date_end, 10);
885 if (date_end != ident.date_end)
886 goto fail_exit; /* malformed date */
887 *(author_date_slab_at(author_date, commit)) = date;
888
889fail_exit:
890 repo_unuse_commit_buffer(the_repository, commit, buffer);
891}
892
893int compare_commits_by_author_date(const void *a_, const void *b_,
894 void *cb_data)

Callers 3

explore_walk_stepFunction · 0.85
init_topo_walkFunction · 0.85

Calls 4

repo_get_commit_bufferFunction · 0.85
find_commit_headerFunction · 0.85
split_ident_lineFunction · 0.85
repo_unuse_commit_bufferFunction · 0.85

Tested by

no test coverage detected