Files
git/Documentation
Paul Tan eb2a8d9ed3 pull: handle git-fetch's options as well
While parsing the command-line arguments, git-pull stops parsing at the
first unrecognized option, assuming that any subsequent options are for
git-fetch, and can thus be kept in the shell's positional parameters
list, so that it can be passed to git-fetch via the expansion of "$@".

However, certain functions in git-pull assume that the positional
parameters do not contain any options:

* error_on_no_merge_candidates() uses the number of positional
  parameters to determine which error message to print out, and will
  thus print the wrong message if git-fetch's options are passed in as
  well.

* the call to get_remote_merge_branch() assumes that the positional
  parameters only contains the optional repo and refspecs, and will
  thus silently fail if git-fetch's options are passed in as well.

* --dry-run is a valid git-fetch option, but if provided after any
  git-fetch options, it is not recognized by git-pull and thus git-pull
  will continue to run the merge or rebase.

Fix these bugs by teaching git-pull to parse git-fetch's options as
well. Add tests to prevent regressions.

This removes the limitation where git-fetch's options have to come after
git-merge's and git-rebase's options on the command line. Update the
documentation to reflect this.

Signed-off-by: Paul Tan <pyokagan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-06-02 13:36:22 -07:00
..
2015-06-01 12:47:56 -07:00
2015-05-11 14:39:28 -07:00
2015-06-01 12:45:19 -07:00
2014-11-04 13:14:44 -08:00
2013-09-04 12:23:25 -07:00
2014-11-04 13:14:44 -08:00
2014-11-04 13:14:44 -08:00
2015-05-11 14:39:28 -07:00
2015-05-19 13:17:57 -07:00
2013-10-18 13:50:12 -07:00
2013-04-12 12:00:52 -07:00
2015-05-26 13:50:51 -07:00
2014-11-04 13:14:44 -08:00
2015-01-22 13:44:14 -08:00