Write the tree before finding the parent commits
This commit is contained in:
parent
0366d0f8cb
commit
bee4c2002d
1 changed files with 7 additions and 8 deletions
|
@ -139,6 +139,13 @@ impl StoreIdAccessor for UpdateHook {
|
|||
.map_into_hook_error()
|
||||
);
|
||||
|
||||
let tree_id = try!(
|
||||
index.write_tree()
|
||||
.map_err_into(GHEK::RepositoryIndexWritingError)
|
||||
.map_dbg_err_str("Failed to write tree")
|
||||
.map_into_hook_error()
|
||||
);
|
||||
|
||||
let mut parents = Vec::new();
|
||||
{
|
||||
let commit = try!(
|
||||
|
@ -153,14 +160,6 @@ impl StoreIdAccessor for UpdateHook {
|
|||
// for converting from Vec<Commit> to Vec<&Commit>
|
||||
let parents = parents.iter().collect::<Vec<_>>();
|
||||
|
||||
let tree_id = try!(
|
||||
index.write_tree()
|
||||
.map_err_into(GHEK::RepositoryIndexWritingError)
|
||||
.map_dbg_err_str("Failed to write tree")
|
||||
.map_into_hook_error()
|
||||
);
|
||||
|
||||
|
||||
let tree = try!(
|
||||
repo.find_tree(tree_id)
|
||||
.map_err_into(GHEK::RepositoryParentFetchingError)
|
||||
|
|
Loading…
Reference in a new issue