mirror of
https://github.com/git/git.git
synced 2024-11-06 17:23:00 +01:00
9e4b7ab652
This removes tentative "git stat" and make it take over "git status". There are some tests that expect "git status" to exit with non-zero status when there is something staged. Some tests expect "git status path..." to show the status for a partial commit. For these, replace "git status" with "git commit --dry-run". For the ones that do not attempt a dry-run of a partial commit that check the output from the command, check the output from "git status" as well, as they should be identical. Signed-off-by: Junio C Hamano <gitster@pobox.com>
60 lines
1.3 KiB
Bash
Executable file
60 lines
1.3 KiB
Bash
Executable file
#!/bin/sh
|
|
|
|
test_description='basic work tree status reporting'
|
|
|
|
. ./test-lib.sh
|
|
|
|
test_expect_success setup '
|
|
test_commit A &&
|
|
test_commit B oneside added &&
|
|
git checkout A^0 &&
|
|
test_commit C oneside created
|
|
'
|
|
|
|
test_expect_success 'A/A conflict' '
|
|
git checkout B^0 &&
|
|
test_must_fail git merge C
|
|
'
|
|
|
|
test_expect_success 'Report path with conflict' '
|
|
git diff --cached --name-status >actual &&
|
|
echo "U oneside" >expect &&
|
|
test_cmp expect actual
|
|
'
|
|
|
|
test_expect_success 'Report new path with conflict' '
|
|
git diff --cached --name-status HEAD^ >actual &&
|
|
echo "U oneside" >expect &&
|
|
test_cmp expect actual
|
|
'
|
|
|
|
cat >expect <<EOF
|
|
# On branch side
|
|
# Unmerged paths:
|
|
# (use "git reset HEAD <file>..." to unstage)
|
|
# (use "git add <file>..." to mark resolution)
|
|
#
|
|
# deleted by us: foo
|
|
#
|
|
no changes added to commit (use "git add" and/or "git commit -a")
|
|
EOF
|
|
|
|
test_expect_success 'M/D conflict does not segfault' '
|
|
mkdir mdconflict &&
|
|
(
|
|
cd mdconflict &&
|
|
git init &&
|
|
test_commit initial foo "" &&
|
|
test_commit modify foo foo &&
|
|
git checkout -b side HEAD^ &&
|
|
git rm foo &&
|
|
git commit -m delete &&
|
|
test_must_fail git merge master &&
|
|
test_must_fail git commit --dry-run >../actual &&
|
|
test_cmp ../expect ../actual &&
|
|
git status >../actual &&
|
|
test_cmp ../expect ../actual
|
|
)
|
|
'
|
|
|
|
test_done
|