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/t3907-stash-show-config.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 / t3907-stash-show-config.sh` 83 lines ยท 1679 bytes Raw Blame History 1 #!/bin/sh 2 3 test_description='Test git stash show configuration.' 4 5 . ./test-lib.sh 6 7 test_expect_success 'setup' ' 8 test_commit file 9 ' 10 11 # takes three parameters: 12 # 1. the stash.showStat value (or "") 13 # 2. the stash.showPatch value (or "") 14 # 3. the diff options of the expected output (or nothing for no output) 15 test_stat_and_patch () { 16 if test "" = "$1" 17 then 18 test_unconfig stash.showStat 19 else 20 test_config stash.showStat "$1" 21 fi && 22 23 if test "" = "$2" 24 then 25 test_unconfig stash.showPatch 26 else 27 test_config stash.showPatch "$2" 28 fi && 29 30 shift 2 && 31 echo 2 >file.t && 32 if test $# != 0 33 then 34 git diff "$@" >expect 35 fi && 36 git stash && 37 git stash show >actual && 38 39 if test $# = 0 40 then 41 test_must_be_empty actual 42 else 43 test_cmp expect actual 44 fi 45 } 46 47 test_expect_success 'showStat unset showPatch unset' ' 48 test_stat_and_patch "" "" --stat 49 ' 50 51 test_expect_success 'showStat unset showPatch false' ' 52 test_stat_and_patch "" false --stat 53 ' 54 55 test_expect_success 'showStat unset showPatch true' ' 56 test_stat_and_patch "" true --stat -p 57 ' 58 59 test_expect_success 'showStat false showPatch unset' ' 60 test_stat_and_patch false "" 61 ' 62 63 test_expect_success 'showStat false showPatch false' ' 64 test_stat_and_patch false false 65 ' 66 67 test_expect_success 'showStat false showPatch true' ' 68 test_stat_and_patch false true -p 69 ' 70 71 test_expect_success 'showStat true showPatch unset' ' 72 test_stat_and_patch true "" --stat 73 ' 74 75 test_expect_success 'showStat true showPatch false' ' 76 test_stat_and_patch true false --stat 77 ' 78 79 test_expect_success 'showStat true showPatch true' ' 80 test_stat_and_patch true true --stat -p 81 ' 82 83 test_done