Re: [PATCH v2 2/3] t7800: fix tests when difftool uses --no-symlinks
Johannes Sixt <j.sixt@viscovery.net> writes:
Show 22 quoted lines
> Am 3/24/2013 16:15, schrieb John Keeping:
> ...
>> + for my $file (keys %worktree) {
>> next if $symlinks && -l "$b/$file";
>> next if ! -f "$b/$file";
>>
>> - my $diff = compare("$b/$file", "$workdir/$file");
>> - if ($diff == 0) {
>> - next;
>> - } elsif ($diff == -1) {
>> - my $errmsg = "warning: Could not compare ";
>> - $errmsg += "'$b/$file' with '$workdir/$file'\n";
>> + my $wt_hash = $repo->command_oneline('hash-object',
>> + "$workdir/$file");
>> + my $tmp_hash = $repo->command_oneline('hash-object',
>> + "$b/$file");
>
> This is gross. Can't we do much better here? Difftool already keeps a
> GIT_INDEX of the files in the temporary tree ($tmpdir/rindex). Running
> git-diff-files should be sufficient to tell which ones where edited via
> the users's diff-tool. Then you can restrict calling hash-object to only
> those worktree files where an "edit collision" needs to be checked for.