git-commit-vandalism/t/t7502-status.sh
Jeff King 46f721c8fe add status.relativePaths config variable
The output of git-status was recently changed to output relative
paths. Setting this variable to false restores the old behavior for
any old-timers that prefer it.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-08 03:33:24 -08:00

123 lines
2.1 KiB
Bash
Executable File

#!/bin/sh
#
# Copyright (c) 2007 Johannes E. Schindelin
#
test_description='git-status'
. ./test-lib.sh
test_expect_success 'setup' '
: > tracked &&
: > modified &&
mkdir dir1 &&
: > dir1/tracked &&
: > dir1/modified &&
mkdir dir2 &&
: > dir1/tracked &&
: > dir1/modified &&
git add . &&
test_tick &&
git commit -m initial &&
: > untracked &&
: > dir1/untracked &&
: > dir2/untracked &&
echo 1 > dir1/modified &&
echo 2 > dir2/modified &&
echo 3 > dir2/added &&
git add dir2/added
'
cat > expect << \EOF
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# new file: dir2/added
#
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
#
# modified: dir1/modified
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# dir1/untracked
# dir2/modified
# dir2/untracked
# expect
# output
# untracked
EOF
test_expect_success 'status' '
git status > output &&
git diff expect output
'
cat > expect << \EOF
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# new file: ../dir2/added
#
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
#
# modified: modified
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# untracked
# ../dir2/modified
# ../dir2/untracked
# ../expect
# ../output
# ../untracked
EOF
test_expect_success 'status with relative paths' '
(cd dir1 && git status) > output &&
git diff expect output
'
cat > expect << \EOF
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# new file: dir2/added
#
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
#
# modified: dir1/modified
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# dir1/untracked
# dir2/modified
# dir2/untracked
# expect
# output
# untracked
EOF
test_expect_success 'status without relative paths' '
git config status.relativePaths false
(cd dir1 && git status) > output &&
git diff expect output
'
test_done