Blame Scripts/Bash/Functions/Vcs/Git/git_updateRepoChanges.sh

de6ddf
#!/bin/bash
de6ddf
#
de6ddf
# git_updateRepoChanges.sh -- This function standardizes the way
de6ddf
# changes are merged into the repository's local working copy.
de6ddf
#
de6ddf
# Copyright (C) 2009-2013 The CentOS Project
de6ddf
#
de6ddf
# This program is free software; you can redistribute it and/or modify
de6ddf
# it under the terms of the GNU General Public License as published by
de6ddf
# the Free Software Foundation; either version 2 of the License, or (at
de6ddf
# your option) any later version.
de6ddf
#
de6ddf
# This program is distributed in the hope that it will be useful, but
de6ddf
# WITHOUT ANY WARRANTY; without even the implied warranty of
de6ddf
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
de6ddf
# General Public License for more details.
de6ddf
#
de6ddf
# You should have received a copy of the GNU General Public License
de6ddf
# along with this program; if not, write to the Free Software
de6ddf
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
de6ddf
#
de6ddf
# ----------------------------------------------------------------------
de6ddf
# $Id$
de6ddf
# ----------------------------------------------------------------------
de6ddf
de6ddf
function git_updateRepoChanges {
de6ddf
de6ddf
    # Print action message.
de6ddf
    cli_printMessage "`gettext "Bringing changes from the repository into the working copy"`" --as-banner-line
de6ddf
de6ddf
    # Update working copy and retrieve update output.  When we use
de6ddf
    # git, it is not possible to bring changes for specific
de6ddf
    # directories trees but the whole repository tree. So, we need to
de6ddf
    # position the script in the local working copy directory and
de6ddf
    # execute the pull command therein.
de6ddf
    #
de6ddf
    # NOTE: The `${COMMAND} pull' command triggers the error `Unable
de6ddf
    # to determine absolute path of git directory' while fetch and
de6ddf
    # merge equivalents seems to do what we expect without any visible
de6ddf
    # error.
de6ddf
    ${COMMAND} fetch
de6ddf
    ${COMMAND} merge FETCH_HEAD
de6ddf
de6ddf
}