Skip to content

Commit

Permalink
doc,tests: force checkout of submodules
Browse files Browse the repository at this point in the history
When updating submodules, always checkout even if the HEAD is the
desired commit hash (update --force) to avoid the following:

    * a directory gmock exists in hammer
    * a submodule gmock replaces the directory gmock in master
    * checkout master + submodule update : gmock/.git is created
    * checkout hammer : the gmock directory still contains the .git from
      master because it did not exist at the time and checkout won't
      remove untracked directories
    * checkout master + submodule update : git rev-parse HEAD is
      at the desired commit although the content of the gmock directory
      is from hammer

http://tracker.ceph.com/issues/11157 Fixes: #11157

Signed-off-by: Loic Dachary <ldachary@redhat.com>
  • Loading branch information
ldachary committed Mar 18, 2015
1 parent 1f58a0a commit c7b02f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion autogen.sh
Expand Up @@ -29,7 +29,8 @@ else
fi

if test -d ".git" ; then
if ! git submodule update --init; then
force=$(if git submodule usage 2>&1 | grep --quiet 'update.*--force'; then echo --force ; fi)
if ! git submodule sync || ! git submodule update $force --init --recursive; then
echo "Error: could not initialize submodule projects"
echo " Network connectivity might be required."
exit 1
Expand Down

0 comments on commit c7b02f5

Please sign in to comment.