diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-02-03 14:16:00 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-02-03 14:16:00 -0800 |
commit | bd6934af9bb8c4b86026d6aeb3a9c85d32ae1790 (patch) | |
tree | 8b4fc8d5947555eeb8fc82d069b106b150ec6b66 /t | |
parent | Merge branch 'tb/ls-files-eol' (diff) | |
parent | ls-remote: add support for showing symrefs (diff) | |
download | tgif-bd6934af9bb8c4b86026d6aeb3a9c85d32ae1790.tar.xz |
Merge branch 'tg/ls-remote-symref'
"ls-remote" learned an option to show which branch the remote
repository advertises as its primary by pointing its HEAD at.
* tg/ls-remote-symref:
ls-remote: add support for showing symrefs
ls-remote: use parse-options api
ls-remote: fix synopsis
ls-remote: document --refs option
ls-remote: document --quiet option
Diffstat (limited to 't')
-rwxr-xr-x | t/t5512-ls-remote.sh | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/t/t5512-ls-remote.sh b/t/t5512-ls-remote.sh index aadaac515e..819b9ddd0f 100755 --- a/t/t5512-ls-remote.sh +++ b/t/t5512-ls-remote.sh @@ -163,4 +163,49 @@ test_expect_success 'overrides work between mixed transfer/upload-pack hideRefs' grep refs/tags/magic actual ' +test_expect_success 'ls-remote --symref' ' + cat >expect <<-\EOF && + ref: refs/heads/master HEAD + 1bd44cb9d13204b0fe1958db0082f5028a16eb3a HEAD + 1bd44cb9d13204b0fe1958db0082f5028a16eb3a refs/heads/master + 1bd44cb9d13204b0fe1958db0082f5028a16eb3a refs/remotes/origin/HEAD + 1bd44cb9d13204b0fe1958db0082f5028a16eb3a refs/remotes/origin/master + 1bd44cb9d13204b0fe1958db0082f5028a16eb3a refs/tags/mark + EOF + git ls-remote --symref >actual && + test_cmp expect actual +' + +test_expect_success 'ls-remote with filtered symref (refname)' ' + cat >expect <<-\EOF && + ref: refs/heads/master HEAD + 1bd44cb9d13204b0fe1958db0082f5028a16eb3a HEAD + EOF + git ls-remote --symref . HEAD >actual && + test_cmp expect actual +' + +test_expect_failure 'ls-remote with filtered symref (--heads)' ' + git symbolic-ref refs/heads/foo refs/tags/mark && + cat >expect <<-\EOF && + ref: refs/tags/mark refs/heads/foo + 1bd44cb9d13204b0fe1958db0082f5028a16eb3a refs/heads/foo + 1bd44cb9d13204b0fe1958db0082f5028a16eb3a refs/heads/master + EOF + git ls-remote --symref --heads . >actual && + test_cmp expect actual +' + +test_expect_success 'ls-remote --symref omits filtered-out matches' ' + cat >expect <<-\EOF && + 1bd44cb9d13204b0fe1958db0082f5028a16eb3a refs/heads/foo + 1bd44cb9d13204b0fe1958db0082f5028a16eb3a refs/heads/master + EOF + git ls-remote --symref --heads . >actual && + test_cmp expect actual && + git ls-remote --symref . "refs/heads/*" >actual && + test_cmp expect actual +' + + test_done |