Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhradeep Chakraborty <chakrabortyabhradeep79@gmail.com>2022-05-09 14:32:48 +0300
committerJunio C Hamano <gitster@pobox.com>2022-05-09 20:53:58 +0300
commitef6d15ca536a50d916f8d9c7f600d650810161b1 (patch)
tree60dda9e1813e4f03756a1b6652c5a6c6935431dd /t/t5505-remote.sh
parent6cd33dceed60949e2dbc32e3f0f5e67c4c882e1e (diff)
builtin/remote.c: teach `-v` to list filters for promisor remotes
`git remote -v` (`--verbose`) lists down the names of remotes along with their URLs. It would be beneficial for users to also specify the filter types for promisor remotes. Something like this - origin remote-url (fetch) [blob:none] origin remote-url (push) Teach `git remote -v` to also specify the filters for promisor remotes. Closes: https://github.com/gitgitgadget/git/issues/1211 Signed-off-by: Abhradeep Chakraborty <chakrabortyabhradeep79@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5505-remote.sh')
-rwxr-xr-xt/t5505-remote.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index c90cf47acd..fff14e13ed 100755
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
@@ -78,6 +78,40 @@ test_expect_success 'add another remote' '
)
'
+test_expect_success 'setup bare clone for server' '
+ git clone --bare "file://$(pwd)/one" srv.bare &&
+ git -C srv.bare config --local uploadpack.allowfilter 1 &&
+ git -C srv.bare config --local uploadpack.allowanysha1inwant 1
+'
+
+test_expect_success 'filters for promisor remotes are listed by git remote -v' '
+ test_when_finished "rm -rf pc" &&
+ git clone --filter=blob:none "file://$(pwd)/srv.bare" pc &&
+ git -C pc remote -v >out &&
+ grep "srv.bare (fetch) \[blob:none\]" out &&
+
+ git -C pc config remote.origin.partialCloneFilter object:type=commit &&
+ git -C pc remote -v >out &&
+ grep "srv.bare (fetch) \[object:type=commit\]" out
+'
+
+test_expect_success 'filters should not be listed for non promisor remotes (remote -v)' '
+ test_when_finished "rm -rf pc" &&
+ git clone one pc &&
+ git -C pc remote -v >out &&
+ ! grep "(fetch) \[.*\]" out
+'
+
+test_expect_success 'filters are listed by git remote -v only' '
+ test_when_finished "rm -rf pc" &&
+ git clone --filter=blob:none "file://$(pwd)/srv.bare" pc &&
+ git -C pc remote >out &&
+ ! grep "\[blob:none\]" out &&
+
+ git -C pc remote show >out &&
+ ! grep "\[blob:none\]" out
+'
+
test_expect_success 'check remote-tracking' '
(
cd test &&