Revision 51a94af845cb3f797abd638478834721d7295af7 authored by Junio C Hamano on 17 October 2008, 06:37:44 UTC, committed by Junio C Hamano on 17 October 2008, 21:35:06 UTC
The test to make sure that checkout fails when --track was asked for and
we cannot set up tracking information in t7201 was wrong, and it turns out
that the implementation for that feature itself was buggy.  This fixes it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 8ed0a74
Raw File
t7101-reset.sh
#!/bin/sh
#
# Copyright (c) 2006 Shawn Pearce
#

test_description='git reset should cull empty subdirs'
. ./test-lib.sh

test_expect_success \
    'creating initial files' \
    'mkdir path0 &&
     cp ../../COPYING path0/COPYING &&
     git add path0/COPYING &&
     git commit -m add -a'

test_expect_success \
    'creating second files' \
    'mkdir path1 &&
     mkdir path1/path2 &&
     cp ../../COPYING path1/path2/COPYING &&
     cp ../../COPYING path1/COPYING &&
     cp ../../COPYING COPYING &&
     cp ../../COPYING path0/COPYING-TOO &&
     git add path1/path2/COPYING &&
     git add path1/COPYING &&
     git add COPYING &&
     git add path0/COPYING-TOO &&
     git commit -m change -a'

test_expect_success \
    'resetting tree HEAD^' \
    'git reset --hard HEAD^'

test_expect_success \
    'checking initial files exist after rewind' \
    'test -d path0 &&
     test -f path0/COPYING'

test_expect_success \
    'checking lack of path1/path2/COPYING' \
    '! test -f path1/path2/COPYING'

test_expect_success \
    'checking lack of path1/COPYING' \
    '! test -f path1/COPYING'

test_expect_success \
    'checking lack of COPYING' \
    '! test -f COPYING'

test_expect_success \
    'checking checking lack of path1/COPYING-TOO' \
    '! test -f path0/COPYING-TOO'

test_expect_success \
    'checking lack of path1/path2' \
    '! test -d path1/path2'

test_expect_success \
    'checking lack of path1' \
    '! test -d path1'

test_done
back to top