mirror of
https://github.com/chocolate-doom/chocpkg.git
synced 2024-11-30 16:01:10 +00:00
Add --ff-only to git pull command.
Don't make or commit merges when running 'git pull' - the assumption is that we're tracking an upstream branch that should always be possible to fast-forward. Better to fail with an error if we can't do this and allow the user to intervene to resolve the problem.
This commit is contained in:
parent
840683540e
commit
900610a0ac
1 changed files with 9 additions and 1 deletions
|
@ -11,7 +11,15 @@ fetch_git::init() {
|
|||
do_fetch() {
|
||||
if [ -e "$PACKAGE_BUILD_DIR/.git" ]; then
|
||||
cd "$PACKAGE_BUILD_DIR"
|
||||
git pull
|
||||
# Assume we're tracking an upstream branch, and to be cautious,
|
||||
# don't ever perform or commit merges. If a merge needs to be made,
|
||||
# let the user resolve the problem themselves.
|
||||
git pull --ff-only || chocpkg::abort \
|
||||
"Failed to cleanly 'git pull' from upstream. You may need to" \
|
||||
"manually resolve merge conflicts with local changes, eg." \
|
||||
"" \
|
||||
" cd $PACKAGE_BUILD_DIR" \
|
||||
" git pull"
|
||||
else
|
||||
git clone -b "$GIT_BRANCH" "$GIT_URL" "$PACKAGE_BUILD_DIR"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue