From: Junio C Hamano Date: Mon, 26 Jun 2017 21:09:32 +0000 (-0700) Subject: Merge branch 'ks/t7508-indent-fix' X-Git-Tag: v2.14.0-rc0~50 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/6968ca9b255d1ee327c36bdd79418aa8d8b2c38f?hp=-c Merge branch 'ks/t7508-indent-fix' Cosmetic update to a test. * ks/t7508-indent-fix: t7508: fix a broken indentation --- 6968ca9b255d1ee327c36bdd79418aa8d8b2c38f diff --combined t/t7508-status.sh index 7121a550c7,b5860fcb8b..f7fe22a195 --- a/t/t7508-status.sh +++ b/t/t7508-status.sh @@@ -32,17 -32,6 +32,17 @@@ test_expect_success 'commit -h in broke test_i18ngrep "[Uu]sage" broken/usage ' +test_expect_success 'create upstream branch' ' + git checkout -b upstream && + test_commit upstream1 && + test_commit upstream2 && + # leave the first commit on master as root because several + # tests depend on this case; for our upstream we only + # care about commit counts anyway, so a totally divergent + # history is OK + git checkout --orphan master +' + test_expect_success 'setup' ' : >tracked && : >modified && @@@ -64,9 -53,7 +64,9 @@@ echo 1 >dir1/modified && echo 2 >dir2/modified && echo 3 >dir2/added && - git add dir2/added + git add dir2/added && + + git branch --set-upstream-to=upstream ' test_expect_success 'status (1)' ' @@@ -88,10 -75,6 +88,10 @@@ EO test_expect_success 'status --column' ' cat >expect <<\EOF && # On branch master +# Your branch and '\''upstream'\'' have diverged, +# and have 1 and 2 different commits each, respectively. +# (use "git pull" to merge the remote branch into yours) +# # Changes to be committed: # (use "git reset HEAD ..." to unstage) # @@@ -122,10 -105,6 +122,10 @@@ test_expect_success 'status --column st cat >expect <<\EOF # On branch master +# Your branch and 'upstream' have diverged, +# and have 1 and 2 different commits each, respectively. +# (use "git pull" to merge the remote branch into yours) +# # Changes to be committed: # (use "git reset HEAD ..." to unstage) # @@@ -199,9 -178,6 +199,9 @@@ test_expect_success 'commit ignores sta cat >expect <<\EOF On branch master +Your branch and 'upstream' have diverged, +and have 1 and 2 different commits each, respectively. + Changes to be committed: new file: dir2/added @@@ -272,10 -248,6 +272,10 @@@ test_expect_success 'status with gitign cat >expect <<\EOF && On branch master +Your branch and '\''upstream'\'' have diverged, +and have 1 and 2 different commits each, respectively. + (use "git pull" to merge the remote branch into yours) + Changes to be committed: (use "git reset HEAD ..." to unstage) @@@ -341,10 -313,6 +341,10 @@@ test_expect_success 'status with gitign cat >expect <<\EOF && On branch master +Your branch and '\''upstream'\'' have diverged, +and have 1 and 2 different commits each, respectively. + (use "git pull" to merge the remote branch into yours) + Changes to be committed: (use "git reset HEAD ..." to unstage) @@@ -380,7 -348,7 +380,7 @@@ output EOF cat >expect <<\EOF -## master +## master...upstream [ahead 1, behind 2] M dir1/modified A dir2/added ?? dir1/untracked @@@ -392,7 -360,7 +392,7 @@@ EO test_expect_success 'status -s -b' ' git status -s -b >output && - test_cmp expect output + test_i18ncmp expect output ' @@@ -402,7 -370,7 +402,7 @@@ test_expect_success 'status -s -z -b' git status -s -z -b >output && nul_to_q output.q && mv output.q output && - test_cmp expect output + test_i18ncmp expect output ' test_expect_success 'setup dir3' ' @@@ -414,10 -382,6 +414,10 @@@ test_expect_success 'status -uno' ' cat >expect <..." to unstage) @@@ -444,9 -408,6 +444,9 @@@ test_expect_success 'status (status.sho test_expect_success 'status -uno (advice.statusHints false)' ' cat >expect <expect <..." to unstage) @@@ -536,10 -493,6 +536,10 @@@ test_expect_success 'status -s (status. test_expect_success 'status -uall' ' cat >expect <..." to unstage) @@@ -599,10 -552,6 +599,10 @@@ test_expect_success 'status -s (status. test_expect_success 'status with relative paths' ' cat >expect <<\EOF && On branch master +Your branch and '\''upstream'\'' have diverged, +and have 1 and 2 different commits each, respectively. + (use "git pull" to merge the remote branch into yours) + Changes to be committed: (use "git reset HEAD ..." to unstage) @@@ -661,19 -610,13 +661,19 @@@ test_expect_success 'status --porcelai test_expect_success 'setup unique colors' ' git config status.color.untracked blue && - git config status.color.branch green + git config status.color.branch green && + git config status.color.localBranch yellow && + git config status.color.remoteBranch cyan ' test_expect_success 'status with color.ui' ' cat >expect <<\EOF && On branch master +Your branch and '\''upstream'\'' have diverged, +and have 1 and 2 different commits each, respectively. + (use "git pull" to merge the remote branch into yours) + Changes to be committed: (use "git reset HEAD ..." to unstage) @@@ -732,7 -675,7 +732,7 @@@ test_expect_success 'status -s with col ' cat >expect <<\EOF -## master +## master...upstream [ahead 1, behind 2] M dir1/modified A dir2/added ?? dir1/untracked @@@ -744,7 -687,7 +744,7 @@@ EO test_expect_success 'status -s -b with color.status' ' git status -s -b | test_decode_color >output && - test_cmp expect output + test_i18ncmp expect output ' @@@ -783,7 -726,7 +783,7 @@@ test_expect_success 'status --porcelai git status --porcelain -b >output && { - echo "## master" && + echo "## master...upstream [ahead 1, behind 2]" && cat expect } >tmp && mv tmp expect && @@@ -796,10 -739,6 +796,10 @@@ test_expect_success 'status without relative paths' ' cat >expect <<\EOF && On branch master +Your branch and '\''upstream'\'' have diverged, +and have 1 and 2 different commits each, respectively. + (use "git pull" to merge the remote branch into yours) + Changes to be committed: (use "git reset HEAD ..." to unstage) @@@ -846,10 -785,6 +846,10 @@@ test_expect_success 'status -s without test_expect_success 'dry-run of partial commit excluding new file in index' ' cat >expect <..." to unstage) @@@ -890,10 -825,6 +890,10 @@@ test_expect_success 'setup status submo test_expect_success 'status submodule summary is disabled by default' ' cat >expect <..." to unstage) @@@ -950,10 -881,6 +950,10 @@@ head=$(cd sm && git rev-parse --short= test_expect_success 'status submodule summary' ' cat >expect <..." to unstage) @@@ -1012,10 -939,6 +1012,10 @@@ test_expect_success 'status -s submodul test_expect_success 'status submodule summary (clean submodule): commit' ' cat >expect <..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory) @@@ -1062,10 -985,6 +1062,10 @@@ test_expect_success 'status -z implies test_expect_success 'commit --dry-run submodule summary (--amend)' ' cat >expect <..." to unstage) @@@ -1119,10 -1038,6 +1119,10 @@@ touch .gitmodule test_expect_success '--ignore-submodules=untracked suppresses submodules with untracked content' ' cat > expect << EOF && On branch master +Your branch and '\''upstream'\'' have diverged, +and have 2 and 2 different commits each, respectively. + (use "git pull" to merge the remote branch into yours) + Changes to be committed: (use "git reset HEAD ..." to unstage) @@@ -1231,10 -1146,6 +1231,10 @@@ test_expect_success '.git/config ignore test_expect_success "--ignore-submodules=untracked doesn't suppress submodules with modified content" ' cat > expect << EOF && On branch master +Your branch and '\''upstream'\'' have diverged, +and have 2 and 2 different commits each, respectively. + (use "git pull" to merge the remote branch into yours) + Changes to be committed: (use "git reset HEAD ..." to unstage) @@@ -1291,10 -1202,6 +1291,10 @@@ head2=$(cd sm && git commit -q -m "2nd test_expect_success "--ignore-submodules=untracked doesn't suppress submodule summary" ' cat > expect << EOF && On branch master +Your branch and '\''upstream'\'' have diverged, +and have 2 and 2 different commits each, respectively. + (use "git pull" to merge the remote branch into yours) + Changes to be committed: (use "git reset HEAD ..." to unstage) @@@ -1375,10 -1282,6 +1375,10 @@@ test_expect_success ".git/config ignore cat > expect << EOF ; On branch master +; Your branch and 'upstream' have diverged, +; and have 2 and 2 different commits each, respectively. +; (use "git pull" to merge the remote branch into yours) +; ; Changes to be committed: ; (use "git reset HEAD ..." to unstage) ; @@@ -1426,10 -1329,6 +1426,10 @@@ test_expect_success "status (core.comme test_expect_success "--ignore-submodules=all suppresses submodule summary" ' cat > expect << EOF && On branch master +Your branch and '\''upstream'\'' have diverged, +and have 2 and 2 different commits each, respectively. + (use "git pull" to merge the remote branch into yours) + Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory) @@@ -1454,10 -1353,6 +1454,10 @@@ EO test_expect_success '.gitmodules ignore=all suppresses unstaged submodule summary' ' cat > expect << EOF && On branch master +Your branch and '\''upstream'\'' have diverged, +and have 2 and 2 different commits each, respectively. + (use "git pull" to merge the remote branch into yours) + Changes to be committed: (use "git reset HEAD ..." to unstage) @@@ -1577,10 -1472,6 +1577,10 @@@ test_expect_success 'git commit --dry-r git add sm && cat >expect << EOF && On branch master +Your branch and '\''upstream'\'' have diverged, +and have 2 and 2 different commits each, respectively. + (use "git pull" to merge the remote branch into yours) + Changes to be committed: (use "git reset HEAD ..." to unstage) @@@ -1603,41 -1494,9 +1603,41 @@@ EO test_expect_success 'git commit -m will commit a staged but ignored submodule' ' git commit -uno -m message && git status -s --ignore-submodules=dirty >output && - test_i18ngrep ! "^M. sm" output && + test_i18ngrep ! "^M. sm" output && git config --remove-section submodule.subname && git config -f .gitmodules --remove-section submodule.subname ' +test_expect_success 'show stash info with "--show-stash"' ' + git reset --hard && + git stash clear && + echo 1 >file && + git add file && + git stash && + git status >expected_default && + git status --show-stash >expected_with_stash && + test_i18ngrep "^Your stash currently has 1 entry$" expected_with_stash +' + +test_expect_success 'no stash info with "--show-stash --no-show-stash"' ' + git status --show-stash --no-show-stash >expected_without_stash && + test_cmp expected_default expected_without_stash +' + +test_expect_success '"status.showStash=false" weaker than "--show-stash"' ' + git -c status.showStash=false status --show-stash >actual && + test_cmp expected_with_stash actual +' + +test_expect_success '"status.showStash=true" weaker than "--no-show-stash"' ' + git -c status.showStash=true status --no-show-stash >actual && + test_cmp expected_without_stash actual +' + +test_expect_success 'no additionnal info if no stash entries' ' + git stash clear && + git -c status.showStash=true status >actual && + test_cmp expected_without_stash actual +' + test_done