@classmethod<EOL><INDENT>def _get_subdirectory(cls, location):<DEDENT>
<EOL>git_dir = cls.run_command(['<STR_LIT>', '<STR_LIT>'],<EOL>show_stdout=False, cwd=location).strip()<EOL>if not os.path.isabs(git_dir):<EOL><INDENT>git_dir = os.path.join(location, git_dir)<EOL><DEDENT>root_dir = os.path.join(git_dir, '<STR_LIT:..>')<EOL>orig_location = location<EOL>while not os.path.exists(os.path.join(location, '<STR_LIT>')):<EOL><INDENT>last_location = location<EOL>location = os.path.dirname(location)<EOL>if location == last_location:<EOL><INDENT>logger.warning(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>",<EOL>orig_location,<EOL>)<EOL>return None<EOL><DEDENT><DEDENT>if samefile(root_dir, location):<EOL><INDENT>return None<EOL><DEDENT>return os.path.relpath(location, root_dir)<EOL>
Return the relative path of setup.py to the git repo root.