diff options
author | Jeff King <peff@peff.net> | 2014-07-13 08:42:12 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-07-14 03:59:05 +0200 |
commit | d66bebcbcfa46d72bb5008e1d211c0ea87200d86 (patch) | |
tree | 7f54d014dc6c832558de19a41ee5d56faa7dd26d /builtin/diff-tree.c | |
parent | alloc: factor out commit index (diff) | |
download | git-d66bebcbcfa46d72bb5008e1d211c0ea87200d86.tar.xz git-d66bebcbcfa46d72bb5008e1d211c0ea87200d86.zip |
object_as_type: set commit index
The point of the "index" field of struct commit is that
every allocated commit would have one. It is supposed to be
an invariant that whenever object->type is set to
OBJ_COMMIT, we have a unique index.
Commit 969eba6 (commit: push commit_index update into
alloc_commit_node, 2014-06-10) covered this case for
newly-allocated commits. However, we may also allocate an
"unknown" object via lookup_unknown_object, and only later
convert it to a commit. We must make sure that we set the
commit index when we switch the type field.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/diff-tree.c')
0 files changed, 0 insertions, 0 deletions