apm_git_checkout_repo (private)

 apm_git_checkout_repo -path path -branch branch

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

Checks out a repository branch or tag, making also sure that this is up to date via 'git pull' (if this is a branch) This assumes the specific Git setup for our repo, hence it is meant for internal use only.

Switches:
-path
(required)
-branch
(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_checkout_repo apm_git_checkout_repo apm_git_build_repository->apm_git_checkout_repo apm_git_repo_branches apm_git_repo_branches (private) apm_git_checkout_repo->apm_git_repo_branches

Testcases:
No testcase defined.
Source code:
    set cd_helper   [file join $::acs::rootdir bin cd-helper]
    set git_command git

    try {
        ns_log Notice "Checking out '$path'"
        exec -ignorestderr -- $cd_helper $path $git_command checkout $branch
    } on error {errmsg} {
        #
        # Checking out a branch that was already checked
        # out will complain. As we know the branch exists
        # for this repo, we are pretty confident this
        # error can be ignored.
        #
        ns_log notice "Checking out existing branch '$branch' for '$path' complained:" $errmsg
    }
    #
    # If we are on a branch, make sure repo is up to date.
    #
    if {$branch in [apm_git_repo_branches -path $path]} {
        ns_log Notice "Updating '$path'"
        exec -ignorestderr -- $cd_helper $path $git_command pull
    }
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: