Merge "Add git_update_remote_branch to functions."
This commit is contained in:
commit
7d0810ec2a
1
AUTHORS
1
AUTHORS
@ -1,6 +1,7 @@
|
||||
Aaron Lee <aaron.lee@rackspace.com>
|
||||
Aaron Rosen <arosen@nicira.com>
|
||||
Adam Gandelman <adamg@canonical.com>
|
||||
Andrew Laski <andrew.laski@rackspace.com>
|
||||
Andy Smith <github@anarkystic.com>
|
||||
Anthony Young <sleepsonthefloor@gmail.com>
|
||||
Armando Migliaccio <armando.migliaccio@eu.citrix.com>
|
||||
|
14
functions
14
functions
@ -278,6 +278,16 @@ function git_update_tag() {
|
||||
}
|
||||
|
||||
|
||||
# git update using reference as a branch.
|
||||
# git_update_remote_branch ref
|
||||
function git_update_remote_branch() {
|
||||
|
||||
GIT_BRANCH=$1
|
||||
|
||||
git checkout -b $GIT_BRANCH -t origin/$GIT_BRANCH
|
||||
}
|
||||
|
||||
|
||||
# Translate the OS version values into common nomenclature
|
||||
# Sets ``DISTRO`` from the ``os_*`` values
|
||||
function GetDistro() {
|
||||
@ -343,6 +353,8 @@ function git_clone {
|
||||
git_update_tag $GIT_REF
|
||||
elif [[ -n "`git show-ref refs/heads/$GIT_REF`" ]]; then
|
||||
git_update_branch $GIT_REF
|
||||
elif [[ -n "`git show-ref refs/remotes/origin/$GIT_REF`" ]]; then
|
||||
git_update_remote_branch $GIT_REF
|
||||
else
|
||||
echo $GIT_REF is neither branch nor tag
|
||||
exit 1
|
||||
@ -816,4 +828,4 @@ $XTRACE
|
||||
|
||||
# Local variables:
|
||||
# -*- mode: Shell-script -*-
|
||||
# End:
|
||||
# End:
|
||||
|
Loading…
Reference in New Issue
Block a user