From 4b3b33a747c325f76b1f6eef89c231609dd4d361 Mon Sep 17 00:00:00 2001 From: Tom Miller Date: Thu, 2 Jan 2014 20:28:51 -0600 Subject: fetch --prune: always print header url If "fetch --prune" is run with no new refs to fetch, but it has refs to prune. Then, the header url is not printed as it would if there were new refs to fetch. Output before this patch: $ git fetch --prune remote-with-no-new-refs x [deleted] (none) -> origin/world Output after this patch: $ git fetch --prune remote-with-no-new-refs From https://github.com/git/git x [deleted] (none) -> origin/test Signed-off-by: Tom Miller Signed-off-by: Junio C Hamano --- t/t5510-fetch.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 't/t5510-fetch.sh') diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh index 5d4581dac8..87e896d3a3 100755 --- a/t/t5510-fetch.sh +++ b/t/t5510-fetch.sh @@ -614,4 +614,16 @@ test_expect_success 'all boundary commits are excluded' ' test_bundle_object_count .git/objects/pack/pack-${pack##pack }.pack 3 ' +test_expect_success 'fetch --prune prints the remotes url' ' + git branch goodbye && + git clone . only-prunes && + git branch -D goodbye && + ( + cd only-prunes && + git fetch --prune origin 2>&1 | head -n1 >../actual + ) && + echo "From ${D}/." >expect && + test_cmp expect actual +' + test_done -- cgit v1.2.3