]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'jk/has-uncommitted-changes-fix'
authorJunio C Hamano <gitster@pobox.com>
Thu, 2 Aug 2018 22:30:37 +0000 (15:30 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 2 Aug 2018 22:30:38 +0000 (15:30 -0700)
"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

1  2 
diff-lib.c
wt-status.c

diff --cc diff-lib.c
index a9f38eb5a3e0e17d111301b581d06876ce5fd510,7eea70e8139672749733c812db3e9848055f53c5..732f684a49c54cdbc3b9708e91c064b7845d7716
@@@ -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);
diff --cc wt-status.c
Simple merge