Skip to content

Commit

Permalink
cherry-pick: demonstrate a segmentation fault
Browse files Browse the repository at this point in the history
In git-for-windows#952, a complicated
scenario was described that leads to a segmentation fault in
cherry-pick.

It boils down to a certain code path involving a renamed file that is
dirty, for which `refresh_cache_entry()` returns `NULL`, and that
`NULL` not being handled properly.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Nov 25, 2016
1 parent e2b2d6a commit 89ffd6e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions t/t3501-revert-cherry-pick.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,16 @@ test_expect_success 'cherry-pick "-" works with arguments' '
test_cmp expect actual
'

test_expect_failure 'cherry-pick fails gracefully with dirty renamed file' '
test_commit to-rename &&
git checkout -b unrelated &&
test_commit unrelated &&
git checkout @{-1} &&
git mv to-rename.t renamed &&
test_tick &&
git commit -m renamed &&
echo modified >renamed &&
git cherry-pick unrelated
'

test_done

0 comments on commit 89ffd6e

Please sign in to comment.