Skip to content

Add test for blame in sub-directory #2023

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions gix-blame/tests/blame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ mktest!(added_line_before_changed_line, "added-line-before-changed-line", 3);
mktest!(same_line_changed_twice, "same-line-changed-twice", 2);
mktest!(coalesce_adjacent_hunks, "coalesce-adjacent-hunks", 1);

mktest!(sub_directory, "sub-directory/sub-directory", 3);

mktest!(resolved_conflict, "resolved-conflict", 2);
mktest!(file_in_one_chain_of_ancestors, "file-in-one-chain-of-ancestors", 1);
mktest!(
Expand Down
12 changes: 12 additions & 0 deletions gix-blame/tests/fixtures/make_blame_repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ git add same-line-changed-twice.txt
git add coalesce-adjacent-hunks.txt
git commit -q -m c2.4

mkdir sub-directory
echo -e "line 1\nline 2" > sub-directory/sub-directory.txt
git add sub-directory/sub-directory.txt
git commit -q -m c2.5

echo "line 3" >> simple.txt
git add simple.txt
git commit -q -m c3
Expand Down Expand Up @@ -105,6 +110,10 @@ cp empty-lines-histogram.txt empty-lines-myers.txt
git add empty-lines-histogram.txt empty-lines-myers.txt
git commit -q -m c4.5

echo -e "line 0\nline 2\nline 3" > sub-directory/sub-directory.txt
git add sub-directory/sub-directory.txt
git commit -q -m c4.6

echo -e "line 0\nline 1\nline 2" > added-lines.txt
echo -e "line 0\nline 1\nline 2\nline 3" > added-lines-around.txt
git add added-lines.txt
Expand Down Expand Up @@ -241,6 +250,9 @@ git blame --porcelain added-line-before-changed-line.txt > .git/added-line-befor
git blame --porcelain same-line-changed-twice.txt > .git/same-line-changed-twice.baseline
git blame --porcelain coalesce-adjacent-hunks.txt > .git/coalesce-adjacent-hunks.baseline

mkdir .git/sub-directory
git blame --porcelain sub-directory/sub-directory.txt > .git/sub-directory/sub-directory.baseline

git blame --porcelain resolved-conflict.txt > .git/resolved-conflict.baseline
git blame --porcelain file-in-one-chain-of-ancestors.txt > .git/file-in-one-chain-of-ancestors.baseline
git blame --porcelain different-file-in-another-chain-of-ancestors.txt > .git/different-file-in-another-chain-of-ancestors.baseline
Expand Down
Loading