def check_git_unchanged(filename, yes=False):
if check_staged(filename):<EOL><INDENT>s = '<STR_LIT>'.format(filename)<EOL>if yes or input(s) in ('<STR_LIT:y>', '<STR_LIT:yes>'):<EOL><INDENT>return<EOL><DEDENT>else:<EOL><INDENT>raise RuntimeError('<STR_LIT>'<EOL>'<STR_LIT>'.format(filename))<EOL><DEDENT><DEDENT>if check_unstaged(filename):<EOL><INDENT>s = '<STR_LIT>'.format(filename)<EOL>if yes or input(s) in ('<STR_LIT:y>', '<STR_LIT:yes>'):<EOL><INDENT>return<EOL><DEDENT>else:<EOL><INDENT>raise RuntimeError('<STR_LIT>'<EOL>'<STR_LIT>'.format(filename))<EOL><DEDENT><DEDENT>
Check git to avoid overwriting user changes.