@@ -1380,9 +1380,8 @@ void free_commit_extra_headers(struct commit_extra_header *extra)
13801380 }
13811381}
13821382
1383- int commit_tree (const char * msg , size_t msg_len ,
1384- const unsigned char * tree ,
1385- struct commit_list * parents , unsigned char * ret ,
1383+ int commit_tree (const char * msg , size_t msg_len , const struct object_id * tree ,
1384+ struct commit_list * parents , struct object_id * ret ,
13861385 const char * author , const char * sign_commit )
13871386{
13881387 struct commit_extra_header * extra = NULL , * * tail = & extra ;
@@ -1511,16 +1510,16 @@ N_("Warning: commit message did not conform to UTF-8.\n"
15111510 "variable i18n.commitencoding to the encoding your project uses.\n" );
15121511
15131512int commit_tree_extended (const char * msg , size_t msg_len ,
1514- const unsigned char * tree ,
1515- struct commit_list * parents , unsigned char * ret ,
1513+ const struct object_id * tree ,
1514+ struct commit_list * parents , struct object_id * ret ,
15161515 const char * author , const char * sign_commit ,
15171516 struct commit_extra_header * extra )
15181517{
15191518 int result ;
15201519 int encoding_is_utf8 ;
15211520 struct strbuf buffer ;
15221521
1523- assert_sha1_type (tree , OBJ_TREE );
1522+ assert_sha1_type (tree -> hash , OBJ_TREE );
15241523
15251524 if (memchr (msg , '\0' , msg_len ))
15261525 return error ("a NUL byte in commit log message not allowed." );
@@ -1529,7 +1528,7 @@ int commit_tree_extended(const char *msg, size_t msg_len,
15291528 encoding_is_utf8 = is_encoding_utf8 (git_commit_encoding );
15301529
15311530 strbuf_init (& buffer , 8192 ); /* should avoid reallocs for the headers */
1532- strbuf_addf (& buffer , "tree %s\n" , sha1_to_hex (tree ));
1531+ strbuf_addf (& buffer , "tree %s\n" , oid_to_hex (tree ));
15331532
15341533 /*
15351534 * NOTE! This ordering means that the same exact tree merged with a
@@ -1568,7 +1567,7 @@ int commit_tree_extended(const char *msg, size_t msg_len,
15681567 goto out ;
15691568 }
15701569
1571- result = write_sha1_file (buffer .buf , buffer .len , commit_type , ret );
1570+ result = write_sha1_file (buffer .buf , buffer .len , commit_type , ret -> hash );
15721571out :
15731572 strbuf_release (& buffer );
15741573 return result ;
0 commit comments