author | Jeff King <peff@peff.net> | |
Tue, 25 May 2010 06:07:25 +0000 (02:07 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 25 May 2010 17:49:54 +0000 (10:49 -0700) | ||
commit | 29609e682226acbdaa3340145792b5bd7a1ef5a8 | |
tree | d199f1698d2518987aaa3eb7d28f7bc451e1fb88 | tree | snapshot |
parent | c8b296450e5148c576697ea4709072b7855aacd5 | commit | diff |
pull: do nothing on --dry-run
Pull was never meant to take --dry-run at all. However, it
passes unknown arguments to git-fetch, which does do a
dry-run. Unfortunately, pull then attempts to merge whatever
cruft was in FETCH_HEAD (which the dry-run fetch will not
have written to).
Even though we never advertise --dry-run as something that
should work, it is still worth being defensive because:
1. Other commands (including fetch) take --dry-run, so a
user might try it.
2. Rather than simply producing an error, it actually
changes the repository in totally unexpected ways.
This patch makes "pull --dry-run" equivalent to "fetch
--dry-run".
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Pull was never meant to take --dry-run at all. However, it
passes unknown arguments to git-fetch, which does do a
dry-run. Unfortunately, pull then attempts to merge whatever
cruft was in FETCH_HEAD (which the dry-run fetch will not
have written to).
Even though we never advertise --dry-run as something that
should work, it is still worth being defensive because:
1. Other commands (including fetch) take --dry-run, so a
user might try it.
2. Rather than simply producing an error, it actually
changes the repository in totally unexpected ways.
This patch makes "pull --dry-run" equivalent to "fetch
--dry-run".
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-pull.sh | diff | blob | history |