Tree

type tree

method (get-object (class tree) (id/name T) (repository T))

method (list-objects (class tree) (repository T) &key test test-not)

Specializers:
((eql :oid) repository)
(remote common-lisp:t)
(tag common-lisp:t)
((eql :oid) odb)
(reference common-lisp:t)

Listing Contents

generic (tree-directory tree &optional pathname)

List objects from a tree. Optional argument pathname a wild pathname that the entries must match.

GIT> (tree-directory
      (commit-tree
       (target
        (repository-head
         (open-repository (merge-pathnames #p"projects/ecl" (user-homedir-pathname)))))))
(#<TREE-BLOB .gitignore (weak) {1007732933}>
 #<TREE-BLOB ANNOUNCEMENT (weak) {1007733AE3}>
 #<TREE-BLOB Copyright (weak) {1007734C53}>
 #<TREE-BLOB INSTALL (weak) {1007735DC3}>
 #<TREE-BLOB LGPL (weak) {1007736F13}>
 #<TREE-BLOB Makefile.in (weak) {10077380D3}>
 #<TREE-BLOB README.1st (weak) {1007739283}>
 #<TREE-BLOB configure (weak) {100773A3F3}>
 #<TREE-TREE contrib/ (weak) {100773B523}>
 #<TREE-TREE examples/ (weak) {100773C683}>
 #<TREE-TREE msvc/ (weak) {100773D7D3}>
 #<TREE-TREE src/ (weak) {100773E8D3}>)
Specializers:
(tree)

Filtering

In the same way that DIRECTORY can take wildcard pathnames to produce limited list of results.

GIT> (directory (merge-pathnames #p"projects/ecl/co*"
                                 (user-homedir-pathname)))
(#P"/home/russell/projects/ecl/configure"
 #P"/home/russell/projects/ecl/contrib/")

TREE-DIRECTORY can be used to limit the results from the directory tree. Using a wild card will filter the results that are returned. Extending on the example above we can just list a subset of the content with.

GIT> (tree-directory
      (get-tree
       (target
        (repository-head
         (open-repository (merge-pathnames #p"projects/ecl"
                                           (user-homedir-pathname))))))
      #P"co*")
(#<TREE-BLOB configure (weak) {1007C11A23}>
 #<TREE-TREE contrib/ (weak) {1007C130F3}>)