--- a/eclass/git-2.eclass +++ a/eclass/git-2.eclass @@ -119,6 +119,14 @@ DEPEND="dev-vcs/git" # non bare repositories. This is useful if you can't operate with bare # checkouts for some reason. +# @ECLASS-VARIABLE: EGIT_FORCE_FETCH_UPDATE +# @DEFAULT_UNSET +# @DESCRIPTION: +# If non-empty this variable forces the git update repo to use git fetch +# no matter the repo type (bare/non bare). This is useful if you are using +# a non bare repo and the remote tends to rebase the tracked branch with +# conflicting commits, as git pull doesn't handle that situation gracefully. + # @ECLASS-VARIABLE: EGIT_NOUNPACK # @DEFAULT_UNSET # @DESCRIPTION: @@ -536,7 +544,7 @@ git-2_migrate_repository() { fi # set various options to work with both targets - if [[ ${bare} ]]; then + if [[ ${bare} || -n ${EGIT_FORCE_FETCH_UPDATE} ]]; then debug-print "${FUNCNAME}: working in bare repository for \"${EGIT_DIR}\"" EGIT_LOCAL_OPTIONS+="${EGIT_OPTIONS} --bare" MOVE_COMMAND="git clone -l -s -n ${EGIT_DIR// /\\ }"