diff --git a/Source/Source.API.php b/Source/Source.API.php index 796f6af..2d28365 100644 --- a/Source/Source.API.php +++ b/Source/Source.API.php @@ -355,6 +355,7 @@ var $files; # array of SourceFile's var $bugs; var $__bugs; + var $repo; /** * Build a new changeset object given certain properties. @@ -449,6 +450,14 @@ } db_query_bound( $t_query, $t_params ); + + /** + * Load/cache repo object. + */ + function load_repo() { + if ( is_null( $this->repo ) ) { + $t_repos = SourceRepo::load_by_changesets( $this ); + $this->repo = array_shift( $t_repos ); } }