Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stash: fix segmentation fault when files were added with intent
After `git add -N <file>`, the index is in a special state. A state for which the built-in stash was not prepared, as it failed to initialize the `rev` structure in that case before using `&rev.pending`. If `reset_tree()` returns a non-zero value, `stash_working_tree()` calls `object_array_clear()` with `&rev.pending`. If `rev` is not initialized, this causes a segmentation fault. Prevent this by initializing `rev` before calling `reset_tree()`. This fixes #2006. [jes: modified the commit message in preparation for sending this patch to the Git mailing list.] Signed-off-by: Matthew Kraai <mkraai@its.jnj.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
- Loading branch information