#!/bin/sh
test_description='Apple Inc. specific tests'
. ./test-lib.sh
TESTROOT=$(pwd)
test_expect_success '<rdar://problem/10238070> -- git add of a path that contains a .git directory' '
rm -rf .git &&
mkdir -p orig/sub/dir/otherdir &&
cd orig/sub &&
echo "1" > dir/file &&
echo "2" > dir/otherdir/file &&
git init --quiet &&
git add -A &&
git commit -m "Initial Commit" --quiet &&
cd - > /dev/null &&
git init --bare --quiet "${TESTROOT}/git_dir.git" &&
git --git-dir="${TESTROOT}/git_dir.git" --work-tree=/ add -f -- "${TESTROOT}/orig/sub/" &&
git --git-dir="${TESTROOT}/git_dir.git" --work-tree=/ add -f -- "${TESTROOT}/orig/" &&
git --git-dir="${TESTROOT}/git_dir.git" --work-tree=/ commit -m "Commit." |
grep -q "2 files changed, 2 insertions"
'
test_done