summaryrefslogtreecommitdiff
path: root/git-commit-script
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2026-07-10 11:39:26 +0000
committerJunio C Hamano <gitster@pobox.com>2026-07-10 08:13:54 -0700
commitd07d09ee43b920f17d00a96ee29621e398136218 (patch)
tree96fc668da09d7a1174b9567823fa6f604763dec8 /git-commit-script
parenta6b8f0143101f35bd5cc59ec5d51c9c4d428620c (diff)
diff: handle NULL return from repo_get_commit_tree()
The `repo_get_commit_tree()` function can return NULL when a commit's tree object is not available (e.g., the commit was parsed but its maybe_tree field is unset and the commit is not in the commit-graph). In cmd_diff(), the return value is immediately dereferenced via ->object without a NULL check, which would crash if the tree cannot be loaded. Add an explicit NULL check and die with a descriptive message. Pointed out by Coverity. Assisted-by: Claude Opus 4.6 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-commit-script')
0 files changed, 0 insertions, 0 deletions