]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t6120-describe.sh
describe tests: improve test for --work-tree & --dirty
[thirdparty/git.git] / t / t6120-describe.sh
index 88fddc91424006e7acce4bc5ed21d725df9a4d66..a83ea15faaf5be976c0ef191fcd71c9c91c0f8a5 100755 (executable)
@@ -151,24 +151,24 @@ test_expect_success 'set-up dirty work tree' '
        echo >>file
 '
 
-check_describe "A-*[0-9a-f]-dirty" --dirty
-
 test_expect_success 'describe --dirty with --work-tree (dirty)' '
+       git describe --dirty >expected &&
        (
                cd "$TEST_DIRECTORY" &&
                git --git-dir "$TRASH_DIRECTORY/.git" --work-tree "$TRASH_DIRECTORY" describe --dirty >"$TRASH_DIRECTORY/out"
        ) &&
-       grep -E "^A-[1-9][0-9]?-g[0-9a-f]+-dirty$" out
+       grep -E "^A-[1-9][0-9]?-g[0-9a-f]+-dirty$" out &&
+       test_cmp expected out
 '
 
-check_describe "A-*[0-9a-f].mod" --dirty=.mod
-
 test_expect_success 'describe --dirty=.mod with --work-tree (dirty)' '
+       git describe --dirty=.mod >expected &&
        (
                cd "$TEST_DIRECTORY" &&
                git --git-dir "$TRASH_DIRECTORY/.git" --work-tree "$TRASH_DIRECTORY" describe --dirty=.mod >"$TRASH_DIRECTORY/out"
        ) &&
-       grep -E "^A-[1-9][0-9]?-g[0-9a-f]+.mod$" out
+       grep -E "^A-[1-9][0-9]?-g[0-9a-f]+.mod$" out &&
+       test_cmp expected out
 '
 
 test_expect_success 'describe --dirty HEAD' '