diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-06-16 18:58:28 -0400 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-06-16 18:58:28 -0400 |
commit | 813bfa255a1e46f05e08dcb587b8f417b995b2d4 (patch) | |
tree | d2feedc9b750edf52788c767cc666daebb8d3884 /src/gitget | |
parent | 8831cc585ae8e9071f8c022bdfaf75e42029d7e4 (diff) | |
parent | 5051daebf722a9020b015feabc4c39e6bdb187f1 (diff) |
Merge branch 'master' of ssh://projects.parabolagnulinux.org:1863/~git/packages/libretools
Conflicts:
src/librefetch/librefetch.8.ronn
Diffstat (limited to 'src/gitget')
-rwxr-xr-x | src/gitget/gitget | 5 | ||||
-rwxr-xr-x | src/gitget/libregit | 9 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/gitget/gitget b/src/gitget/gitget index bcc528c..fe5d46b 100755 --- a/src/gitget/gitget +++ b/src/gitget/gitget @@ -87,7 +87,7 @@ download_git_checkout() { fi fi msg2 "Updating %s %s repo..." "${name}" "git" - if ! git pull origin "$ref"; then + if ! { git fetch --all -p && git checkout "$ref" && git pull origin "$ref"; } ; then # only warn on failure to allow offline builds warning "Failure while updating %s %s repo" "${repo}" "git" fi @@ -145,8 +145,7 @@ download_git_bare() { } usage() { - print 'Usage: %s [OPTIONS] bare URL DIRECTORY' "${0##*/}" - print 'Usage: %s [OPTIONS] checkout URL DIRECTORY' "${0##*/}" + print 'Usage: %s [OPTIONS] [bare|checkout] URL DIRECTORY' "${0##*/}" print 'A URL-handler for git urls. Capable of updating or cloning.' echo prose "Clones or pulls from the git URL, to a local DIRECTORY. If diff --git a/src/gitget/libregit b/src/gitget/libregit index 25550e5..41aefc3 100755 --- a/src/gitget/libregit +++ b/src/gitget/libregit @@ -20,18 +20,17 @@ . libremessages usage() { - print 'Usage: %s repo ref dir' "${0##*/}" + print 'Usage: %s REPO REF DIR' "${0##*/}" print 'A compatability wrapper around `gitget checkout`' echo prose "This exists because gitget used to be called libregit, and took the arguments in this format, and I'm sure there are a few scripts floating around that use it." echo - prose "Clones or pulls from the git URL 'repo', and checks out the git - ref 'ref' to the directory 'dir'." + prose "Clones or pulls from the git URL '<REPO>', and checks out the git + ref '<REF>' to the directory '<DIR>'." } - main() { [[ $# == 3 ]] || { usage >&2; return 1; } repo=$1 @@ -40,3 +39,5 @@ main() { gitget checkout "${repo}#ref=${ref}" "${dir}" } + +main "$@" |