# Initialize repository
git init simpleRepository
cd simpleRepository

# Commit simple file that contains a Dos/Windows-style return
echo "" > test.txt
git add test.txt
git commit -m "Add file with return character"

# Delete the file in another commit (And make branch for easy reference)
git checkout -b abranch
git rm test.txt
git commit -m "Remove file with return character"

# Go back to original commit and turn on automatic end-of-line normalization
git checkout master
echo "* text=auto" > .gitattributes

# Cherry-pick fails with:
# error: Your local changes to the following files would be overwritten...
git cherry-pick abranch

# The failed cherry-pick has caused the file to be marked as "modified"

# But this reset operation will not clear the status
git reset --hard

# This stash operation succeeds, but test.txt still is marked as "modified"
git stash

# It does not seem to be possible to edit test.txt in 
# a way that will cause git to mark it as "unmodified"

# Committing test.txt or clearing .gitattributes does clear
# the "modified" status, but those options are undesirable

# Uncomment these lines if you want to clean up
# cd ..
# rm -Rf simpleRepository
