+ public static function get_commit($git_path, $commit_id) {
+ $args = array("rev-list", "--header", "--max-count=1", $commit_id, "--");
+ $commit_data = self::git_execute($args, $git_path);
+ $commit = self::parse_commit($commit_data);
+ return $commit;
+ }
+
+ public static function get_hash($git_path, $ref) {
+ $args = array("rev-parse", "--verify", "-q", $ref);
+ $result = self::git_execute($args, $git_path);
+ if(prag_match("#([a-f0-9]{40})#i", $result, $match))
+ return $match[1];
+ return null;
+ }
+