diff options
Diffstat (limited to 't/t6120-describe.sh')
-rwxr-xr-x | t/t6120-describe.sh | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/t/t6120-describe.sh b/t/t6120-describe.sh index 1a501ee09e..d8af2bb9d2 100755 --- a/t/t6120-describe.sh +++ b/t/t6120-describe.sh @@ -107,7 +107,8 @@ test_expect_success 'describe --contains defaults to HEAD without commit-ish' ' check_describe tags/A --all A^0 test_expect_success 'renaming tag A to Q locally produces a warning' " - mv .git/refs/tags/A .git/refs/tags/Q && + git update-ref refs/tags/Q $(git rev-parse refs/tags/A) && + git update-ref -d refs/tags/A && git describe HEAD 2>err >out && cat >expected <<-\EOF && warning: tag 'Q' is externally known as 'A' @@ -135,7 +136,8 @@ test_expect_success 'abbrev=0 will not break misplaced tag (2)' ' ' test_expect_success 'rename tag Q back to A' ' - mv .git/refs/tags/Q .git/refs/tags/A + git update-ref refs/tags/A $(git rev-parse refs/tags/Q) && + git update-ref -d refs/tags/Q ' test_expect_success 'pack tag refs' 'git pack-refs' @@ -260,7 +262,7 @@ test_expect_success 'name-rev --all' ' >expect.unsorted && for rev in $(git rev-list --all) do - git name-rev $rev >>expect.unsorted + git name-rev $rev >>expect.unsorted || return 1 done && sort <expect.unsorted >expect && git name-rev --all >actual.unsorted && @@ -273,7 +275,7 @@ test_expect_success 'name-rev --stdin' ' for rev in $(git rev-list --all) do name=$(git name-rev --name-only $rev) && - echo "$rev ($name)" >>expect.unsorted + echo "$rev ($name)" >>expect.unsorted || return 1 done && sort <expect.unsorted >expect && git rev-list --all | git name-rev --stdin >actual.unsorted && @@ -388,9 +390,12 @@ test_expect_success ULIMIT_STACK_SIZE 'name-rev works in a deep repo' ' committer A U Thor <author@example.com> $((1000000000 + $i * 100)) +0200 data <<EOF commit #$i -EOF" - test $i = 1 && echo "from refs/heads/main^0" - i=$(($i + 1)) +EOF" && + if test $i = 1 + then + echo "from refs/heads/main^0" + fi && + i=$(($i + 1)) || return 1 done | git fast-import && git checkout main && git tag far-far-away HEAD^ && |