diff options
author | Dennis Kaarsemaker <dennis@kaarsemaker.net> | 2016-01-05 22:12:10 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-01-05 13:41:06 -0800 |
commit | aecad374ae7492cc7b2add5fa416d43e1f68c18e (patch) | |
tree | 0803b378a4b228e46f6e8c83730590ac345dc694 /levenshtein.c | |
parent | Merge branch 'sg/lock-file-commit-error' into maint (diff) | |
download | tgif-aecad374ae7492cc7b2add5fa416d43e1f68c18e.tar.xz |
reflog-walk: don't segfault on non-commit sha1's in the reflog
git reflog (ab)uses the log machinery to display its list of log
entries. To do so it must fake commit parent information for the log
walker.
For refs in refs/heads this is no problem, as they should only ever
point to commits. Tags and other refs however can point to anything,
thus their reflog may contain non-commit objects.
To avoid segfaulting, we check whether reflog entries are commits before
feeding them to the log walker and skip any non-commits. This means that
git reflog output will be incomplete for such refs, but that's one step
up from segfaulting. A more complete solution would be to decouple git
reflog from the log walker machinery.
Signed-off-by: Dennis Kaarsemaker <dennis@kaarsemaker.net>
Helped-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'levenshtein.c')
0 files changed, 0 insertions, 0 deletions