#!/bin/bash
exit_code=0

# get the staged files
s_files=$(git diff --name-only --cached --diff-filter=d)

# if a staged file contains the keyword, get it out of the staged list
for s_file in ${s_files};do
    if git grep -q -E -iF "@NOCHECKIN" :$s_file;then
        echo "WARNING: ${s_file} contains the keyword @NOCHECKIN"
        exit_code=1
    fi
done

exit $exit_code
