Use 'git fetch' followed by 'git reset' to update the source tree. This
is better than 'git pull' because it can handle a rewritten upstream
branch and does not leave local modifications. After fetch, parse
FETCH_HEAD to find the merge head that 'git pull' would choose to track
the upstream branch. Then reset to the selected head.
In the normal fast-forward case the behavior remains unchanged.
However, now local modifications and commits will be erased, and
upstream rewrites are handled smoothly. This ensures that the upstream
branch is tested as expected.
This commit cherry-picks and squashes the following commits:
4685872 "FortranCInterface: Fix PathScale detection..." (2010-02-16)
b39fe94 "Fix problem with ExternalProject test..." (2010-02-17)
70290e1 "Add support for QtDeclartive module" (2010-02-17)
282ba89 "Clarify CMAKE_MODULE_PATH documentation" (2010-02-18)
4eba05d "Suppress GNU flag -fPIC on Windows" (2010-02-19)
57efb4a "BUG: We shouldn't be setting the HideWindow..." (2010-02-19)