<commit_before>#!/bin/sh
#
# Copyright (c) 2006 <NAME>
#

test_description='Test of the various options to git-rm.'

. ./test-lib.sh

# Setup some files to be removed, some with funny characters
touch -- foo bar baz 'space embedded' -q
git-add -- foo bar baz 'space embedded' -q
git-commit -m "add normal files"
test_tabs=y
if touch -- 'tab	embedded' 'newline
embedded'
then
git-add -- 'tab	embedded' 'newline
embedded'
git-commit -m "add files with tabs and newlines"
else
    say 'Your filesystem does not allow tabs in filenames.'
    test_tabs=n
fi

# Later we will try removing an unremovable path to make sure
# git-rm barfs, but if the test is run as root that cannot be
# arranged.
: >test-file
chmod a-w .
rm -f test-file
test -f test-file && test_failed_remove=y
chmod 775 .
rm -f test-file

test_expect_success \
    'Pre-check that foo exists and is in index before git-rm foo' \
    '[ -f foo ] && git-ls-files --error-unmatch foo'

test_expect_success \
    'Test that git-rm foo succeeds' \
    'git-rm foo'

test_expect_success \
    'Post-check that foo exists but is not in index after git-rm foo' \
    '[ -f foo ] && ! git-ls-files --error-unmatch foo'

test_expect_success \
    'Pre-check that bar exists and is in index before "git-rm -f bar"' \
    '[ -f bar ] && git-ls-files --error-unmatch bar'

test_expect_success \
    'Test that "git-rm -f bar" succeeds' \
    'git-rm -f bar'

test_expect_success \
    'Post-check that bar does not exist and is not in index after "git-rm -f bar"' \<commit_msg>Remove unnecessary output from t3600-rm.<commit_after>#!/bin/sh
#
# Copyright (c) 2006 <NAME>
#

test_description='Test of the various options to git-rm.'

. ./test-lib.sh

# Setup some files to be removed, some with funny characters
test_expect_success \
    'Initialize test directory' \
    "touch -- foo bar baz 'space embedded' -q &&
     git-add -- foo bar baz 'space embedded' -q &&
     git-commit -m 'add normal files' &&
     test_tabs=y &&
     if touch -- 'tab	embedded' 'newline
embedded'
     then
     git-add -- 'tab	embedded' 'newline
embedded' &&
     git-commit -m 'add files with tabs and newlines'
     else
         say 'Your filesystem does not allow tabs in filenames.'
         test_tabs=n
     fi"

# Later we will try removing an unremovable path to make sure
# git-rm barfs, but if the test is run as root that cannot be
# arranged.
test_expect_success \
    'Determine rm behavior' \
    ': >test-file
     chmod a-w .
     rm -f test-file
     test -f test-file && test_failed_remove=y
     chmod 775 .
     rm -f test-file'

test_expect_success \
    'Pre-check that foo exists and is in index before git-rm foo' \
    '[ -f foo ] && git-ls-files --error-unmatch foo'

test_expect_success \
    'Test that git-rm foo succeeds' \
    'git-rm foo'

test_expect_success \
    'Post-check that foo exists but is not in index after git-rm foo' \
    '[ -f foo ] && ! git-ls-files --error-unmatch foo'

test_expect_success \
    'Pre-check that bar exists and is in index before "git-rm -f bar"' \
    '[ -f bar ] && git-ls-files --error-unmatch bar'

test_expect_success \
    'Test that "git-rm -f bar" succeeds' \
    'git-rm -f bar'

test_expect_success \
    'Post-check that bar does not exist and is not in index after "git-rm -f bar"' \
{'fraction_non_alphanumeric': 0.11104368932038836, 'fraction_numerical': 0.0054611650485436895, 'mean_word_length': 2.6879194630872485, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '2429956', 'n_tokens_mistral': 1139, 'n_tokens_neox': 1104, 'n_words': 418}