Require instead of include for required files
[gitphp.git] / include / gitutil.git_ls_tree.php
blob:a/include/gitutil.git_ls_tree.php -> blob:b/include/gitutil.git_ls_tree.php
<?php <?php
/* /*
* gitutil.git_ls_tree.php * gitutil.git_ls_tree.php
* gitphp: A PHP git repository browser * gitphp: A PHP git repository browser
* Component: Git utility - list tree * Component: Git utility - list tree
* *
* Copyright (C) 2008 Christopher Han <xiphux@gmail.com> * Copyright (C) 2008 Christopher Han <xiphux@gmail.com>
*/ */
   
require_once('defs.commands.php'); require_once('defs.commands.php');
require_once('gitutil.git_exec.php'); require_once('gitutil.git_exec.php');
   
function git_ls_tree($proj,$hash,$nullterm = FALSE) function git_ls_tree($proj,$hash,$nullterm = FALSE, $recurse = FALSE)
{ {
$cmd = GIT_LS_TREE; $cmd = GIT_LS_TREE;
if ($nullterm) if ($nullterm)
$cmd .= " -z"; $cmd .= " -z";
  if ($recurse)
  $cmd .= " -r -t --full-name";
return git_exec($proj, $cmd . " " . $hash); return git_exec($proj, $cmd . " " . $hash);
} }
   
?> ?>
   
comments