Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Write the diff and patch checks as the suite does
git -C, test_cmp with expect and actual, and rev-list --max-parents=0
for the root commit, the forms the other files use.
Diffstat (limited to '')
| -rwxr-xr-x | tests/t0109-patch.sh | 22 |
1 file changed, 11 insertions, 11 deletions
diff --git a/tests/t0109-patch.sh b/tests/t0109-patch.sh index f37a23e..18ed501 100755 --- a/tests/t0109-patch.sh +++ b/tests/t0109-patch.sh @@ -22,14 +22,14 @@ test_expect_success 'generate foo/patch' ' ' test_expect_success 'compare with output of git-format-patch(1)' ' - git --git-dir="$PWD/repos/foo/.git" format-patch --subject-prefix="" \ - --signature="cgit" --stdout HEAD^ >tmp2 && - strip_headers <tmp >tmp_ && - test_cmp tmp_ tmp2 + git -C repos/foo format-patch --subject-prefix="" \ + --signature="cgit" --stdout HEAD^ >expect && + strip_headers <tmp >actual && + test_cmp expect actual ' test_expect_success 'find initial commit' ' - root=$(git --git-dir="$PWD/repos/foo/.git" rev-list --max-parents=0 HEAD) + root=$(git -C repos/foo rev-list --max-parents=0 HEAD) ' test_expect_success 'generate patch for initial commit' ' @@ -41,16 +41,16 @@ test_expect_success 'find `cgit` signature on the initial commit' ' ' test_expect_success 'generate patches for multiple commits' ' - id=$(git --git-dir="$PWD/repos/foo/.git" rev-parse HEAD) && - id2=$(git --git-dir="$PWD/repos/foo/.git" rev-parse HEAD~3) && + id=$(git -C repos/foo rev-parse HEAD) && + id2=$(git -C repos/foo rev-parse HEAD~3) && cgit_url "foo/patch&id=$id&id2=$id2" >tmp ' test_expect_success 'compare the range with git-format-patch(1)' ' - git --git-dir="$PWD/repos/foo/.git" format-patch --subject-prefix="" \ - -N --signature="cgit" --stdout HEAD~3..HEAD >tmp2 && - strip_headers <tmp >tmp_ && - test_cmp tmp_ tmp2 + git -C repos/foo format-patch --subject-prefix="" \ + -N --signature="cgit" --stdout HEAD~3..HEAD >expect && + strip_headers <tmp >actual && + test_cmp expect actual ' test_expect_success 'max-patch-count bounds a patch range' ' |
