forked from git/git
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This topic branch fixes a segmentation fault when using `-G` or `-S --pickaxe-regex` with `git diff` on new-born files that are configured without user diff drivers, and that hence get mmap()ed into memory. Signed-off-by: Johannes Schindelin <[email protected]>
- Loading branch information
Showing
3 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/sh | ||
# | ||
# Copyright (c) 2016 Johannes Schindelin | ||
# | ||
|
||
test_description='Pickaxe options' | ||
|
||
. ./test-lib.sh | ||
|
||
test_expect_success setup ' | ||
test_commit initial && | ||
printf "%04096d" 0 >4096-zeroes.txt && | ||
git add 4096-zeroes.txt && | ||
test_tick && | ||
git commit -m "A 4k file" | ||
' | ||
test_expect_success '-G matches' ' | ||
git diff --name-only -G "^0{4096}$" HEAD^ >out && | ||
test 4096-zeroes.txt = "$(cat out)" | ||
' | ||
|
||
test_done |