do not segfault if make_cache_entry failed
Signed-off-by: Dmitry Potapov <dpotapov@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
This commit is contained in:

committed by
Shawn O. Pearce

parent
52e8370bc7
commit
048f276200
@ -2586,6 +2586,8 @@ static void build_fake_ancestor(struct patch *list, const char *filename)
|
||||
sha1_ptr = sha1;
|
||||
|
||||
ce = make_cache_entry(patch->old_mode, sha1_ptr, name, 0, 0);
|
||||
if (!ce)
|
||||
die("make_cache_entry failed for path '%s'", name);
|
||||
if (add_index_entry(&result, ce, ADD_CACHE_OK_TO_ADD))
|
||||
die ("Could not add %s to temporary index", name);
|
||||
}
|
||||
|
Reference in New Issue
Block a user