@@ -100,7 +100,7 @@ sub changed_files
100
100
101
101
sub setup_dir_diff
102
102
{
103
- my ($workdir , $symlinks ) = @_ ;
103
+ my ($worktree , $symlinks ) = @_ ;
104
104
my @gitargs = (' diff' , ' --raw' , ' --no-abbrev' , ' -z' , @ARGV );
105
105
my $diffrtn = Git::command_oneline(@gitargs );
106
106
exit (0) unless defined ($diffrtn );
@@ -109,7 +109,7 @@ sub setup_dir_diff
109
109
# changed files. The paths returned by diff --raw are relative to the
110
110
# top-level of the repository, but we defer changing directories so
111
111
# that @ARGV can perform pathspec limiting in the current directory.
112
- chdir ($workdir );
112
+ chdir ($worktree );
113
113
114
114
# Build index info for left and right sides of the diff
115
115
my $submodule_mode = ' 160000' ;
@@ -121,7 +121,7 @@ sub setup_dir_diff
121
121
my $wtindex = ' ' ;
122
122
my %submodule ;
123
123
my %symlink ;
124
- my @working_tree = ();
124
+ my @files = ();
125
125
my %working_tree_dups = ();
126
126
my @rawdiff = split (' \0' , $diffrtn );
127
127
@@ -173,14 +173,14 @@ sub setup_dir_diff
173
173
}
174
174
175
175
if ($rmode ne $null_mode ) {
176
- # Avoid duplicate working_tree entries
176
+ # Avoid duplicate entries
177
177
if ($working_tree_dups {$dst_path }++) {
178
178
next ;
179
179
}
180
180
my ($use , $wt_sha1 ) =
181
181
use_wt_file($dst_path , $rsha1 );
182
182
if ($use ) {
183
- push @working_tree , $dst_path ;
183
+ push @files , $dst_path ;
184
184
$wtindex .= " $rmode $wt_sha1 \t $dst_path \0 " ;
185
185
} else {
186
186
$rindex .= " $rmode $rsha1 \t $dst_path \0 " ;
@@ -227,14 +227,14 @@ sub setup_dir_diff
227
227
228
228
# Changes in the working tree need special treatment since they are
229
229
# not part of the index.
230
- for my $file (@working_tree ) {
230
+ for my $file (@files ) {
231
231
my $dir = dirname($file );
232
232
unless (-d " $rdir /$dir " ) {
233
233
mkpath(" $rdir /$dir " ) or
234
234
exit_cleanup($tmpdir , 1);
235
235
}
236
236
if ($symlinks ) {
237
- symlink (" $workdir /$file " , " $rdir /$file " ) or
237
+ symlink (" $worktree /$file " , " $rdir /$file " ) or
238
238
exit_cleanup($tmpdir , 1);
239
239
} else {
240
240
copy($file , " $rdir /$file " ) or
@@ -278,7 +278,7 @@ sub setup_dir_diff
278
278
exit_cleanup($tmpdir , 1) if not $ok ;
279
279
}
280
280
281
- return ($ldir , $rdir , $tmpdir , @working_tree );
281
+ return ($ldir , $rdir , $tmpdir , @files );
282
282
}
283
283
284
284
sub write_to_file
@@ -388,9 +388,9 @@ sub dir_diff
388
388
my $error = 0;
389
389
my $repo = Git-> repository();
390
390
my $repo_path = $repo -> repo_path();
391
- my $workdir = $repo -> wc_path();
392
- $workdir =~ s | /$|| ; # Avoid double slashes in symlink targets
393
- my ($a , $b , $tmpdir , @worktree ) = setup_dir_diff($workdir , $symlinks );
391
+ my $worktree = $repo -> wc_path();
392
+ $worktree =~ s | /$|| ; # Avoid double slashes in symlink targets
393
+ my ($a , $b , $tmpdir , @files ) = setup_dir_diff($worktree , $symlinks );
394
394
395
395
if (defined ($extcmd )) {
396
396
$rc = system ($extcmd , $a , $b );
@@ -411,21 +411,21 @@ sub dir_diff
411
411
my %tmp_modified ;
412
412
my $indices_loaded = 0;
413
413
414
- for my $file (@worktree ) {
414
+ for my $file (@files ) {
415
415
next if $symlinks && -l " $b /$file " ;
416
416
next if ! -f " $b /$file " ;
417
417
418
418
if (!$indices_loaded ) {
419
419
%wt_modified = changed_files(
420
- $repo_path , " $tmpdir /wtindex" , $workdir );
420
+ $repo_path , " $tmpdir /wtindex" , $worktree );
421
421
%tmp_modified = changed_files(
422
422
$repo_path , " $tmpdir /wtindex" , $b );
423
423
$indices_loaded = 1;
424
424
}
425
425
426
426
if (exists $wt_modified {$file } and exists $tmp_modified {$file }) {
427
427
my $errmsg = " warning: Both files modified: " ;
428
- $errmsg .= " '$workdir /$file ' and '$b /$file '.\n " ;
428
+ $errmsg .= " '$worktree /$file ' and '$b /$file '.\n " ;
429
429
$errmsg .= " warning: Working tree file has been left.\n " ;
430
430
$errmsg .= " warning:\n " ;
431
431
warn $errmsg ;
0 commit comments