diff options
author | Paul Tan <pyokagan@gmail.com> | 2015-06-02 22:22:52 +0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-06-02 13:36:22 -0700 |
commit | eb2a8d9ed3fca2ba2f617b704992d483605f3bb6 (patch) | |
tree | 1fb26b8369f33f0db94d36d91742d221c74b67b4 /Documentation/git-pull.txt | |
parent | Merge branch 'pt/pull-tests' into pt/pull-optparse (diff) | |
download | tgif-eb2a8d9ed3fca2ba2f617b704992d483605f3bb6.tar.xz |
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>
Diffstat (limited to 'Documentation/git-pull.txt')
-rw-r--r-- | Documentation/git-pull.txt | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/Documentation/git-pull.txt b/Documentation/git-pull.txt index 712ab4baed..93c72a29ce 100644 --- a/Documentation/git-pull.txt +++ b/Documentation/git-pull.txt @@ -74,9 +74,6 @@ pulling or stash them away with linkgit:git-stash[1]. OPTIONS ------- -Options meant for 'git pull' itself and the underlying 'git merge' -must be given before the options meant for 'git fetch'. - -q:: --quiet:: This is passed to both underlying git-fetch to squelch reporting of |