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 &&
'
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 &&
"%(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" \