Submodule update fails when the submodule isn't clean

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      Jenkins doesn't forcibly update submodules. This means that a checkout can fail with:

      hudson.plugins.git.GitException: Command "git submodule update --init --recursive modules/gmock" returned status code 1:
      stdout: 
      stderr: error: Your local changes to the following files would be overwritten by checkout:
      build-aux/config.guess
      build-aux/config.sub
      gtest/build-aux/config.guess
      gtest/build-aux/config.sub
      Please, commit your changes or stash them before you can switch branches.
      Aborting
      Unable to checkout 'ec44c6c1675c25b9827aacd08c02433cccde7780' in submodule path 'modules/gmock'
      

      Note, while JENKINS-22510 is relevant, and cleaning the checkout before checking out would resolve the problem, that's not a viable solution. Cleaning the checkout throws away all built files, which means the build is no longer incremental.

      Note, this means the behaviour for submodules doesn't match it's behaviour for the standard checkout (which is checked out with --force).

            Assignee:
            Richard Whitehouse
            Reporter:
            Richard Whitehouse
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: