diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-01-10 10:32:50 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-01-10 10:32:50 -0800 |
commit | 666b4c2670f013bc1747f1db9b72a4b25266cec2 (patch) | |
tree | 2e8d29034a9b3b8ce3e114add1062e1677a558f6 /t | |
parent | Merge branch 'sb/diff-orderfile-config' (diff) | |
parent | fetch --prune: Run prune before fetching (diff) | |
download | tgif-666b4c2670f013bc1747f1db9b72a4b25266cec2.tar.xz |
Merge branch 'tm/fetch-prune'
Fetching 'frotz' branch with "git fetch", while having
'frotz/nitfol' remote-tracking branch from an earlier fetch, would
error out, primarily because the command has not been told to
remove anything on our side. In such a case, "git fetch --prune"
can be used to remove 'frotz/nitfol' to make room to fetch and
store 'frotz' remote-tracking branch.
* tm/fetch-prune:
fetch --prune: Run prune before fetching
fetch --prune: always print header url
Diffstat (limited to 't')
-rwxr-xr-x | t/t5510-fetch.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh index 5d4581dac8..12674ac098 100755 --- a/t/t5510-fetch.sh +++ b/t/t5510-fetch.sh @@ -614,4 +614,30 @@ 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_expect_success 'branchname D/F conflict resolved by --prune' ' + git branch dir/file && + git clone . prune-df-conflict && + git branch -D dir/file && + git branch dir && + ( + cd prune-df-conflict && + git fetch --prune && + git rev-parse origin/dir >../actual + ) && + git rev-parse dir >expect && + test_cmp expect actual +' + test_done |