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/t5408-send-pack-stdin.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 / t5408-send-pack-stdin.sh` 102 lines ยท 2478 bytes Raw Blame History 1 #!/bin/sh 2 3 test_description='send-pack --stdin tests' 4 5 . ./test-lib.sh 6 7 create_ref () { 8 tree=$(git write-tree) && 9 test_tick && 10 commit=$(echo "$1" | git commit-tree $tree) && 11 git update-ref "$1" $commit 12 } 13 14 clear_remote () { 15 rm -rf remote.git && 16 git init --bare remote.git 17 } 18 19 verify_push () { 20 git rev-parse "$1" >expect && 21 git --git-dir=remote.git rev-parse "${2:-$1}" >actual && 22 test_cmp expect actual 23 } 24 25 test_expect_success 'setup refs' ' 26 cat >refs <<-\EOF && 27 refs/heads/A 28 refs/heads/C 29 refs/tags/D 30 refs/heads/B 31 refs/tags/E 32 EOF 33 for i in $(cat refs); do 34 create_ref $i || return 1 35 done 36 ' 37 38 # sanity check our setup 39 test_expect_success 'refs on cmdline' ' 40 clear_remote && 41 git send-pack remote.git $(cat refs) && 42 for i in $(cat refs); do 43 verify_push $i || return 1 44 done 45 ' 46 47 test_expect_success 'refs over stdin' ' 48 clear_remote && 49 git send-pack remote.git --stdin input && 58 git send-pack remote.git --stdin input && 65 git send-pack remote.git --stdin B err && 73 test_grep "multiple updates for ref ${SQ}refs/heads/foo${SQ} not allowed" err && 74 test_must_fail git --git-dir=remote.git rev-parse foo 75 ' 76 77 test_expect_success 'cmdline refs with multiple duplicates' ' 78 clear_remote && 79 test_must_fail git send-pack remote.git A:foo B:foo C:foo 2>err && 80 test_grep "multiple updates for ref ${SQ}refs/heads/foo${SQ} not allowed" err && 81 test_must_fail git --git-dir=remote.git rev-parse foo 82 ' 83 84 test_expect_success '--stdin refs come after cmdline' ' 85 clear_remote && 86 echo A:foo >input && 87 test_must_fail git send-pack remote.git --stdin B:foo