summaryrefslogtreecommitdiff
path: root/src/gitget/gitget
diff options
context:
space:
mode:
Diffstat (limited to 'src/gitget/gitget')
-rwxr-xr-xsrc/gitget/gitget11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gitget/gitget b/src/gitget/gitget
index 194ec05..fe5d46b 100755
--- a/src/gitget/gitget
+++ b/src/gitget/gitget
@@ -1,7 +1,9 @@
#!/usr/bin/env bash
-# Copyright (c) 2012-2013 Pacman Development Team <pacman-dev@archlinux.org>
-# Copyright (c) 2012-2013 Luke Shumaker <lukeshu@sbcglobal.net>
+# Copyright (C) 2012-2013 Pacman Development Team <pacman-dev@archlinux.org>
+# Copyright (C) 2012-2013 Luke Shumaker <lukeshu@sbcglobal.net>
+#
+# License: GNU GPLv2+
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -85,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
@@ -143,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