]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t3104-ls-tree-format.sh
Merge branch 'rs/ls-tree-path-expansion-fix'
[thirdparty/git.git] / t / t3104-ls-tree-format.sh
index 7e6c4dc5dadaa1941e6646a4f79db932d71b3f4a..3adb206a93bc58aac509a1f093f9dd86cb98e5be 100755 (executable)
@@ -4,6 +4,7 @@ test_description='ls-tree --format'
 
 TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-t3100.sh
 
 test_expect_success 'ls-tree --format usage' '
        test_expect_code 129 git ls-tree --format=fmt -l HEAD &&
@@ -12,16 +13,13 @@ test_expect_success 'ls-tree --format usage' '
 '
 
 test_expect_success 'setup' '
-       mkdir dir &&
-       test_commit dir/sub-file &&
-       test_commit top-file
+       setup_basic_ls_tree_data
 '
 
 test_ls_tree_format () {
        format=$1 &&
        opts=$2 &&
        fmtopts=$3 &&
-       shift 2 &&
 
        test_expect_success "ls-tree '--format=<$format>' is like options '$opts $fmtopts'" '
                git ls-tree $opts -r HEAD >expect &&
@@ -55,6 +53,15 @@ test_ls_tree_format \
        "%(path)" \
        "--name-only"
 
+test_ls_tree_format \
+       "%(objectname)" \
+       "--object-only"
+
+test_ls_tree_format \
+       "%(objectname)" \
+       "--object-only --abbrev" \
+       "--abbrev"
+
 test_ls_tree_format \
        "%(objectmode) %(objecttype) %(objectname)%x09%(path)" \
        "-t" \