make sure not in subdirectory before commit