mirror of
https://github.com/git/git
synced 2024-08-24 18:26:02 +00:00
add -p: trap Ctrl-D in 'goto' mode
If the user hit Ctrl-D (EOF) while the script was in 'go to hunk?' mode, it threw an undefined variable error. Explicitly test for EOF and have it re-enter the goto prompt loop. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
4404b2e392
commit
68c02d7c46
|
@ -994,6 +994,9 @@ sub patch_update_file {
|
|||
}
|
||||
print "go to which hunk$extra? ";
|
||||
$response = <STDIN>;
|
||||
if (!defined $response) {
|
||||
$response = '';
|
||||
}
|
||||
chomp $response;
|
||||
}
|
||||
if ($response !~ /^\s*\d+\s*$/) {
|
||||
|
|
Loading…
Reference in a new issue