File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ struct commit *lookup_commit(unsigned char *sha1)
12
12
struct commit * ret = malloc (sizeof (struct commit ));
13
13
memset (ret , 0 , sizeof (struct commit ));
14
14
created_object (sha1 , & ret -> object );
15
+ ret -> object .type = commit_type ;
15
16
return ret ;
16
17
}
17
18
if (obj -> parsed && obj -> type != commit_type ) {
@@ -56,7 +57,6 @@ int parse_commit(struct commit *item)
56
57
if (strcmp (type , commit_type ))
57
58
return error ("Object %s not a commit" ,
58
59
sha1_to_hex (item -> object .sha1 ));
59
- item -> object .type = commit_type ;
60
60
get_sha1_hex (bufptr + 5 , parent );
61
61
item -> tree = lookup_tree (parent );
62
62
add_ref (& item -> object , & item -> tree -> object );
Original file line number Diff line number Diff line change @@ -77,6 +77,7 @@ struct tree *lookup_tree(unsigned char *sha1)
77
77
struct tree * ret = malloc (sizeof (struct tree ));
78
78
memset (ret , 0 , sizeof (struct tree ));
79
79
created_object (sha1 , & ret -> object );
80
+ ret -> object .type = tree_type ;
80
81
return ret ;
81
82
}
82
83
if (obj -> parsed && obj -> type != tree_type ) {
@@ -96,7 +97,6 @@ int parse_tree(struct tree *item)
96
97
if (item -> object .parsed )
97
98
return 0 ;
98
99
item -> object .parsed = 1 ;
99
- item -> object .type = tree_type ;
100
100
buffer = bufptr = read_sha1_file (item -> object .sha1 , type , & size );
101
101
if (!buffer )
102
102
return error ("Could not read %s" ,
You can’t perform that action at this time.
0 commit comments