From: Junio C Hamano Date: Thu, 2 Aug 2018 22:30:37 +0000 (-0700) Subject: Merge branch 'jk/has-uncommitted-changes-fix' X-Git-Tag: v2.19.0-rc0~116 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/218608cacd478bfdf4bfe40ed7d0b11af94a6a60?hp=--cc 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 --- 218608cacd478bfdf4bfe40ed7d0b11af94a6a60 diff --cc diff-lib.c index a9f38eb5a3,7eea70e813..732f684a49 --- a/diff-lib.c +++ b/diff-lib.c @@@ -518,8 -512,10 +518,11 @@@ static int diff_cache(struct rev_info * 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);