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/t7525-status-rename.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 / t7525-status-rename.sh` 113 lines ยท 2834 bytes Raw Blame History 1 #!/bin/sh 2 3 test_description='git status rename detection options' 4 5 . ./test-lib.sh 6 7 test_expect_success 'setup' ' 8 echo 1 >original && 9 git add . && 10 git commit -m"Adding original file." && 11 mv original renamed && 12 echo 2 >> renamed && 13 git add . && 14 cat >.gitignore <<-\EOF 15 .gitignore 16 expect* 17 actual* 18 EOF 19 ' 20 21 test_expect_success 'status no-options' ' 22 git status >actual && 23 test_grep "renamed:" actual 24 ' 25 26 test_expect_success 'status --no-renames' ' 27 git status --no-renames >actual && 28 test_grep "deleted:" actual && 29 test_grep "new file:" actual 30 ' 31 32 test_expect_success 'status.renames inherits from diff.renames false' ' 33 git -c diff.renames=false status >actual && 34 test_grep "deleted:" actual && 35 test_grep "new file:" actual 36 ' 37 38 test_expect_success 'status.renames inherits from diff.renames true' ' 39 git -c diff.renames=true status >actual && 40 test_grep "renamed:" actual 41 ' 42 43 test_expect_success 'status.renames overrides diff.renames false' ' 44 git -c diff.renames=true -c status.renames=false status >actual && 45 test_grep "deleted:" actual && 46 test_grep "new file:" actual 47 ' 48 49 test_expect_success 'status.renames overrides from diff.renames true' ' 50 git -c diff.renames=false -c status.renames=true status >actual && 51 test_grep "renamed:" actual 52 ' 53 54 test_expect_success 'status status.renames=false' ' 55 git -c status.renames=false status >actual && 56 test_grep "deleted:" actual && 57 test_grep "new file:" actual 58 ' 59 60 test_expect_success 'status status.renames=true' ' 61 git -c status.renames=true status >actual && 62 test_grep "renamed:" actual 63 ' 64 65 test_expect_success 'commit honors status.renames=false' ' 66 git -c status.renames=false commit --dry-run >actual && 67 test_grep "deleted:" actual && 68 test_grep "new file:" actual 69 ' 70 71 test_expect_success 'commit honors status.renames=true' ' 72 git -c status.renames=true commit --dry-run >actual && 73 test_grep "renamed:" actual 74 ' 75 76 test_expect_success 'status config overridden' ' 77 git -c status.renames=true status --no-renames >actual && 78 test_grep "deleted:" actual && 79 test_grep "new file:" actual 80 ' 81 82 test_expect_success 'status score=100%' ' 83 git status -M=100% >actual && 84 test_grep "deleted:" actual && 85 test_grep "new file:" actual && 86 87 git status --find-renames=100% >actual && 88 test_grep "deleted:" actual && 89 test_grep "new file:" actual 90 ' 91 92 test_expect_success 'status score=01%' ' 93 git status -M=01% >actual && 94 test_grep "renamed:" actual && 95 96 git status --find-renames=01% >actual && 97 test_grep "renamed:" actual 98 ' 99 100 test_expect_success 'copies not overridden by find-renames' ' 101 cp renamed copy && 102 git add copy && 103 104 git -c status.renames=copies status -M=01% >actual && 105 test_grep "copied:" actual && 106 test_grep "renamed:" actual && 107 108 git -c status.renames=copies status --find-renames=01% >actual && 109 test_grep "copied:" actual && 110 test_grep "renamed:" actual 111 ' 112 113 test_done