fetch --prune: Run prune before fetching
authorTom Miller <jackerran@gmail.com>
Fri, 3 Jan 2014 02:28:52 +0000 (20:28 -0600)
committerJunio C Hamano <gitster@pobox.com>
Fri, 3 Jan 2014 18:18:40 +0000 (10:18 -0800)
commit10a6cc8890ec1e5459c05ddeb28a671acdc37d60
treeb94074e834f8b4d77217e9df35c8d4d76a21a0ea
parent4b3b33a747c325f76b1f6eef89c231609dd4d361
fetch --prune: Run prune before fetching

When we have a remote-tracking branch named "frotz/nitfol" from a
previous fetch, and the upstream now has a branch named "frotz",
fetch would fail to remove "frotz/nitfol" with a "git fetch --prune"
from the upstream. git would inform the user to use "git remote
prune" to fix the problem.

Change the way "fetch --prune" works by moving the pruning operation
before the fetching operation. This way, instead of warning the user
of a conflict, it autmatically fixes it.

Signed-off-by: Tom Miller <jackerran@gmail.com>
Tested-by: Thomas Rast <tr@thomasrast.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fetch.c
t/t5510-fetch.sh