mirror of
https://github.com/git/git.git
synced 2024-11-27 12:03:55 +08:00
Refactor patch_update_cmd
Split patch_update_cmd into two functions, one to prompt the user for a path to patch and another to do the actual work given that file path. This lays the groundwork for a future commit which will teach git-add--interactive to accept a path parameter and jump directly to the patch subcommand for that path, bypassing the interactive prompt. Signed-off-by: Wincent Colaiuta <win@wincent.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
5f5b611805
commit
a7d9da6c97
@ -564,10 +564,12 @@ sub patch_update_cmd {
|
||||
IMMEDIATE => 1,
|
||||
HEADER => $status_head, },
|
||||
@mods);
|
||||
return if (!$it);
|
||||
patch_update_file($it->{VALUE}) if ($it);
|
||||
}
|
||||
|
||||
sub patch_update_file {
|
||||
my ($ix, $num);
|
||||
my $path = $it->{VALUE};
|
||||
my $path = shift;
|
||||
my ($head, @hunk) = parse_diff($path);
|
||||
for (@{$head->{TEXT}}) {
|
||||
print;
|
||||
|
Loading…
Reference in New Issue
Block a user