Skip to content

Commit 49969f0

Browse files
Hunk sections should use the full path, not basename() (Addresses #280)
1 parent 068c0ec commit 49969f0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

diff-so-fancy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ sub do_dsf_stuff {
241241
}
242242

243243
my ($orig_offset, $orig_count, $new_offset, $new_count) = parse_hunk_header($hunk_header);
244-
$last_file_seen = basename($last_file_seen);
244+
#$last_file_seen = basename($last_file_seen);
245245

246246
# Figure out the start line
247247
my $start_line = start_line_calc($new_offset,$new_count);

test/diff-so-fancy.bats

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,15 +177,15 @@ output=$( load_fixture "ls-function" | $diff_so_fancy )
177177
output=$( load_fixture "dotfiles" | $diff_so_fancy )
178178
run printf "%s" "$output"
179179

180-
assert_line --index 188 --partial "@ diff-so-fancy:1 @"
180+
assert_line --index 188 --partial "@ bin/diff-so-fancy:1 @"
181181
}
182182

183183
@test "Hunk formatting: @@@ -A,B -C,D +E,F @@@" {
184184
# stderr forced into output
185185
output=$( load_fixture "complex-hunks" | $diff_so_fancy 2>&1 )
186186
run printf "%s" "$output"
187187

188-
assert_line --index 4 --partial "@ header_clean.pl:107 @"
188+
assert_line --index 4 --partial "@ libs/header_clean/header_clean.pl:107 @"
189189
refute_output --partial 'Use of uninitialized value'
190190
}
191191

@@ -221,5 +221,5 @@ output=$( load_fixture "ls-function" | $diff_so_fancy )
221221
run printf "%s" "$output"
222222

223223
assert_line --index 1 --partial "modified: doc/manual.xml.head"
224-
assert_line --index 3 --partial "@ manual.xml.head:8355 @"
224+
assert_line --index 3 --partial "@ doc/manual.xml.head:8355 @"
225225
}

0 commit comments

Comments
 (0)