Re: [PATCH 3/3] difftool: use Git::* functions instead of passing around state
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 19, 2016, 18:29 UTC
- Message-ID
- <xmqqtwflfpn6.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20160719035756.24961-3-davvid@gmail.com>
David Aguilar <davvid@gmail.com> writes:
> Call Git::command() and friends directly wherever possible. > This makes it clear that these operations can be invoked directly > without needing to manage the current directory and related GIT_* > environment variables.
Good.
Show 13 quoted lines
> @@ -88,11 +80,11 @@ sub changed_files
> my @refreshargs = (
> @gitargs, 'update-index',
> '--really-refresh', '-q', '--unmerged');
> - my @diffargs = (@gitargs, 'diff-files', '--name-only', '-z');
> try {
> Git::command_oneline(@refreshargs);
> } catch Git::Error::Command with {};
>
> + my @diffargs = (@gitargs, 'diff-files', '--name-only', '-z');
> my $line = Git::command_oneline(@diffargs);
> my @files;
> if (defined $line) {This hunk looks like "oops, the @diffargs variable logically belongs here, not there", correcting an mistake in an earlier step.