3 # List contents of a particular tree in the repository
4 # Copyright (c) Petr Baudis, 2005
6 # Optionally takes a commit or tree ID as a parameter, defaulting to
11 # -r TREE_ID:: List contents of the given tree (you can use revisions here)
12 # List the contents of the given TREE_ID (which can be any tree
13 # id, but most usually you will just use a revision id here).
17 # Each line in the output has the following format:
19 # <mode> <type> <sha1> <name>
24 # The file permission information in octal format.
27 # The type can be the following: `blob` refers to files
28 # and `tree` refers to directories.
34 # The file or directory name.
38 # 100644 blob c7dacd0ea28994e3c754ca4eadb2e08c011ee3d3 README
42 USAGE
="cg-admin-ls [-r TREE_ID] [PATH]"
45 .
"${COGITO_LIB}"cg-Xlib ||
exit 1
50 # Deprecated as of 2006-11-17
51 warn
"cg-admin-ls -t is deprecated, please use -r instead"
53 elif optparse
-r=; then
60 id
="$(cg-object-id -t "$tree_id")" ||
exit 1
62 git-ls-tree
"$id" "${ARGS[@]}"