diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-08-03 00:30:37 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-08-03 00:30:38 +0200 |
commit | 218608cacd478bfdf4bfe40ed7d0b11af94a6a60 (patch) | |
tree | c30026405afe95aa26fd0003387e00afe05f17d5 /diff-lib.c | |
parent | Fourth batch for 2.19 cycle (diff) | |
parent | has_uncommitted_changes(): fall back to empty tree (diff) | |
download | git-218608cacd478bfdf4bfe40ed7d0b11af94a6a60.tar.xz git-218608cacd478bfdf4bfe40ed7d0b11af94a6a60.zip |
Merge branch 'jk/has-uncommitted-changes-fix'
"git pull --rebase" on a corrupt HEAD caused a segfault. In
general we substitute an empty tree object when running the in-core
equivalent of the diff-index command, and the codepath has been
corrected to do so as well to fix this issue.
* jk/has-uncommitted-changes-fix:
has_uncommitted_changes(): fall back to empty tree
Diffstat (limited to 'diff-lib.c')
-rw-r--r-- | diff-lib.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/diff-lib.c b/diff-lib.c index a9f38eb5a3..732f684a49 100644 --- a/diff-lib.c +++ b/diff-lib.c @@ -520,6 +520,9 @@ int run_diff_index(struct rev_info *revs, int cached) struct object_array_entry *ent; uint64_t start = getnanotime(); + if (revs->pending.nr != 1) + BUG("run_diff_index must be passed exactly one tree"); + ent = revs->pending.objects; if (diff_cache(revs, &ent->item->oid, ent->name, cached)) exit(128); |