Do a git pull instead of git clone when appropriate.

When building a git package, invoke git pull if we already did a
previous build and have the checkout already.
This commit is contained in:
Simon Howard 2016-02-18 23:44:35 -05:00
parent b3bce89f50
commit 3ad8b4a563

View file

@ -9,6 +9,11 @@ fetch_git::init() {
}
do_fetch() {
git clone -b "$GIT_BRANCH" "$GIT_URL" "$PACKAGE_BUILD_DIR"
if [ -e "$PACKAGE_BUILD_DIR/.git" ]; then
cd "$PACKAGE_BUILD_DIR"
git pull
else
git clone -b "$GIT_BRANCH" "$GIT_URL" "$PACKAGE_BUILD_DIR"
fi
}