apm_git_fetch_repo (private)

 apm_git_fetch_repo -path path -repo repo

Defined in packages/acs-admin/tcl/apm-admin-procs.tcl

Fetches a repo from the Git mirror. Clones it first when it does not exist. This assumes the specific Git setup for our repo, hence it is meant for internal use only.

Switches:
-path
(required)
-repo
(required)
Returns:
list of branch names

Partial Call Graph (max 5 caller/called nodes):
%3 apm_git_build_repository apm_git_build_repository (private) apm_git_fetch_repo apm_git_fetch_repo apm_git_build_repository->apm_git_fetch_repo

Testcases:
No testcase defined.
Source code:
    set git_url     https://github.com/openacs
    set cd_helper   [file join $::acs::rootdir bin cd-helper]
    set git_command git

    set repo_dir ${path}${repo}
    if {[file isdirectory $repo_dir]} {
        #
        # Folder exists. We fetch from the repo to see if new branches
        # exist.
        #
        ns_log notice "Fetching new branches for '$repo_dir'"
        exec -ignorestderr -- $cd_helper $repo_dir $git_command fetch origin
    } else {
        #
        # Folder does not exist. Clone the repo from scratch.
        #
        ns_log notice "Cloning '${git_url}/${repo}.git' in '$repo_dir'"
        try {
            exec -ignorestderr -- $cd_helper $path $git_command clone ${git_url}/${repo}.git
        } on error {errmsg} {
            if {$repo eq "openacs-core"} {
                error $errmsg
            }
            #
            # Tolerate errors when cloning non-core packages: some
            # legacy packages require authentication and would fail.
            #
            ns_log warning "Could not clone '$repo' from '${git_url}/${repo}.git':" $errmsg
        }
    }
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
packages/acs-admin/tcl/apm-admin-procs.xql

[ hide source ] | [ make this the default ]
Show another procedure: