submodule: do not copy unknown update mode from .gitmodules

When submodule.$name.update is given as hint from the upstream in
the .gitmodules file, we used to blindly copy it to .git/config,
unless there already is a value defined for the submodule.

However, there is no reason to expect that the update mode hinted by
the upstream is available in the version of Git the user is using,
and a really custom "!cmd" prepared by an upstream person running on
Linux may not even be available to a user on Windows.  It is simply
irresponsible to copy the setting blindly and to attempt to use it
during a later "submodule update" without validating it first.

Just show the suggested value to the diagnostic output, and set the
value to 'none' in the configuration, if it is not one of the ones
that are known to be supported by this version of Git.

Helped-by: Jens Lehmann <Jens.Lehmann@web.de>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Git 1.8.4.5

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Sync with 1.8.4.5
ref-iteration doc: add_submodule_odb() returns 0 for success

The usage sample of add_submodule_odb() function in the Submodules
section expects non-zero return value for success, but the function
actually reports success with zero.

Helped-by: René Scharfe <l.s.r@web.de>
Reviewed-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Nick Townsend <nick.townsend@mac.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Git 1.8.5.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge tag 'v1.8.5.1' into fc/master

Git 1.8.5.1

* tag 'v1.8.5.1':
  Git 1.8.5.1
  ref-iteration doc: add_submodule_odb() returns 0 for success
  Git 1.8.4.5
  submodule: do not copy unknown update mode from .gitmodules

Conflicts:
	GIT-VERSION-GEN