diff options
author | Dmitry Potapov <dpotapov@gmail.com> | 2008-10-05 06:14:40 +0400 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2008-10-06 07:19:36 -0700 |
commit | 048f2762007d022defceb6850a44bc1bd5ccebf7 (patch) | |
tree | b24ddcc05a34b4bb45331519ce76a80a62de0f51 /builtin-apply.c | |
parent | 52e8370bc7a71366b664ece0a9ec0b79d673a356 (diff) | |
download | git-048f2762007d022defceb6850a44bc1bd5ccebf7.tar.gz git-048f2762007d022defceb6850a44bc1bd5ccebf7.tar.xz |
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>
Diffstat (limited to 'builtin-apply.c')
-rw-r--r-- | builtin-apply.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin-apply.c b/builtin-apply.c index e2c611bf9..342f2fe5e 100644 --- a/builtin-apply.c +++ b/builtin-apply.c @@ -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); } |