Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/t/t5618-alternate-refs.sh # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / t / t5618-alternate-refs.sh` 86 lines ยท 2744 bytes Raw Blame History 1 #!/bin/sh 2 3 test_description='test handling of --alternate-refs traversal' 4 5 . ./test-lib.sh 6 7 # Avoid test_commit because we want a specific and known set of refs: 8 # 9 # base -- one 10 # \ \ 11 # two -- merged 12 # 13 # where "one" and "two" are on separate refs, and "merged" is available only in 14 # the dependent child repository. 15 test_expect_success 'set up local refs' ' 16 git checkout -b one && 17 test_tick && 18 git commit --allow-empty -m base && 19 test_tick && 20 git commit --allow-empty -m one && 21 git checkout -b two HEAD^ && 22 test_tick && 23 git commit --allow-empty -m two 24 ' 25 26 # We'll enter the child repository after it's set up since that's where 27 # all of the subsequent tests will want to run (and it's easy to forget a 28 # "-C child" and get nonsense results). 29 test_expect_success 'set up shared clone' ' 30 git clone -s . child && 31 cd child && 32 git merge origin/one 33 ' 34 35 test_expect_success 'rev-list --alternate-refs' ' 36 git rev-list --remotes=origin >expect && 37 git rev-list --alternate-refs >actual && 38 test_cmp expect actual 39 ' 40 41 test_expect_success 'rev-list --not --alternate-refs' ' 42 git rev-parse HEAD >expect && 43 git rev-list HEAD --not --alternate-refs >actual && 44 test_cmp expect actual 45 ' 46 47 test_expect_success 'limiting with alternateRefsPrefixes' ' 48 test_config core.alternateRefsPrefixes refs/heads/one && 49 git rev-list origin/one >expect && 50 git rev-list --alternate-refs >actual && 51 test_cmp expect actual 52 ' 53 54 test_expect_success 'log --source shows .alternate marker' ' 55 git log --oneline --source --remotes=origin >expect.orig && 56 sed "s/origin.* /.alternate /" expect && 57 git log --oneline --source --alternate-refs >actual && 58 test_cmp expect actual 59 ' 60 61 test_expect_success 'connectivity check of a fetch excludes alternate refs' ' 62 GIT_TRACE2_EVENT="$(pwd)/fetch.trace" git fetch origin && 63 test_subcommand_flex git rev-list --objects --stdin --not --all \ 64 --alternate-refs --quiet >.git/objects/info/alternates && 80 git cat-file -e $shallow_tip && 81 git rev-list --remotes=origin >expect && 82 git rev-list --alternate-refs >actual && 83 test_cmp expect actual 84 ' 85 86 test_done