<commit_before>echo ">>> Setup a basic repo"
dir_name="PreCommitHookAddTest"
rm -rf $dir_name
mkdir $dir_name; cd $dir_name 
git init; git commit --allow-empty -m "Initial commit"

echo ">>> Add a pre-commit hook that stages a file"
echo "unset $(git rev-parse --local-env-vars); touch b; git add b" > .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit

echo ">>> Try committing a new file using the '-o' flag"
touch c
git add c
git commit -o -m "Commit that ran the pre-commit hook and should contain file 'b'" -- c

echo ">>> Results (expected: working copy clean)"
git status --porcelain

echo ">>> Stage the file after the fact"
git add b

echo ">>> Notice how the working copy is now clean"
git status --porcelain<commit_msg>Updated 91565510 repro script.<commit_after>echo "----> Setup a new test repo"
dir_name="PreCommitHookAddTest"
rm -rf $dir_name; mkdir $dir_name; cd $dir_name
git init; git commit --allow-empty -m "Initial commit"

echo "----> Add a pre-commit hook that stages a file that doesn't currently exist in the repo"
echo "touch auto-added; git add auto-added" > .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit

echo "----> Try committing a new file using the '-o' flag"
touch manually-added; git add manually-added
git commit -o -m "Commit that ran the pre-commit hook and should contain file 'auto-added'" -- manually-added

echo "----> Results (expected: working copy clean; actual: auto-added is reported as both DELETED and UNTRACKED. HEAD and working copy are the same, staging area contains ‘incorrect' state)"
git status

echo "----> Stage the file after the fact"
git add auto-added

echo "----> Notice that the working copy is now clean"
git status
{'fraction_non_alphanumeric': 0.11670616113744076, 'fraction_numerical': 0.004739336492890996, 'mean_word_length': 3.867435158501441, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5608234', 'n_tokens_mistral': 526, 'n_tokens_neox': 521, 'n_words': 237}