Changes since v3: - Commit replacing raw buffer does not store temporary pointer to strbuf internals any more. - Commit message of patch 4 explains all alternative approaches considered so far. - Patch 4 uses two-phases to parse graft line, without code repetition. I have my reservations about patch 4 from readability standpoint (it's not immediately clear why parsing code can skip freeing of graft in phase 2), but this implementation seems to address every issue raised in review so far. If you'll prefer me to go back to impementation from v3, I have it prepared ;) Patryk Obara (4): sha1_file: fix definition of null_sha1 commit: replace the raw buffer with strbuf in read_graft_line commit: allocate array using object_id size commit: rewrite read_graft_line builtin/blame.c | 2 +- commit.c | 45 +++++++++++++++++++++++++-------------------- commit.h | 2 +- sha1_file.c | 2 +- 4 files changed, 28 insertions(+), 23 deletions(-) -- 2.9.5