Skip to content

Commit

Permalink
merge-recursive: get rid of virtual_id
Browse files Browse the repository at this point in the history
We now just leave the object->sha1 field of virtual commits 0{40} as it
is initialized, as a unique hash is not necessary in case of virtual
commits.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Miklos Vajna authored and Junio C Hamano committed Sep 5, 2008
1 parent 696ee23 commit a6f63ae
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions merge-recursive.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,14 @@ static struct tree *shift_tree_object(struct tree *one, struct tree *two)
}

/*
* A virtual commit has
* - (const char *)commit->util set to the name, and
* - *(int *)commit->object.sha1 set to the virtual id.
* A virtual commit has (const char *)commit->util set to the name.
*/

struct commit *make_virtual_commit(struct tree *tree, const char *comment)
{
struct commit *commit = xcalloc(1, sizeof(struct commit));
static unsigned virtual_id = 1;
commit->tree = tree;
commit->util = (void*)comment;
*(int*)commit->object.sha1 = virtual_id++;
/* avoid warnings */
commit->object.parsed = 1;
return commit;
Expand Down

0 comments on commit a6f63ae

Please sign in to comment.