author | Carlos Martín Nieto <cmn@elego.de> | |
Sat, 15 Oct 2011 05:04:25 +0000 (07:04 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 16 Oct 2011 04:56:13 +0000 (21:56 -0700) | ||
commit | ed43de6ec35dfd4c4bd33ae9b5f2ebe38282209f | |
tree | 941a49f45a789b247840f52e74183a52a066500b | tree | snapshot |
parent | c500352e0de75db34b1a071a9e250b815d10f95b | commit | diff |
fetch: honor the user-provided refspecs when pruning refs
If the user gave us refspecs on the command line, we should use those
when deciding whether to prune a ref instead of relying on the
refspecs in the config.
Previously, running
git fetch --prune origin refs/heads/master:refs/remotes/origin/master
would delete every other ref under the origin namespace because we
were using the refspec to filter the available refs but using the
configured refspec to figure out if a ref had been deleted on the
remote. This is clearly the wrong thing to do.
Change prune_refs and get_stale_heads to simply accept a list of
references and a list of refspecs. The caller of either function needs
to decide what refspecs should be used to decide whether a ref is
stale.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
If the user gave us refspecs on the command line, we should use those
when deciding whether to prune a ref instead of relying on the
refspecs in the config.
Previously, running
git fetch --prune origin refs/heads/master:refs/remotes/origin/master
would delete every other ref under the origin namespace because we
were using the refspec to filter the available refs but using the
configured refspec to figure out if a ref had been deleted on the
remote. This is clearly the wrong thing to do.
Change prune_refs and get_stale_heads to simply accept a list of
references and a list of refspecs. The caller of either function needs
to decide what refspecs should be used to decide whether a ref is
stale.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fetch.c | diff | blob | history | |
builtin/remote.c | diff | blob | history | |
remote.c | diff | blob | history | |
remote.h | diff | blob | history | |
t/t5510-fetch.sh | diff | blob | history |