def find_repository_searches_ancestors_for_working_directory(): with temporary_directory() as directory: repository_path = os.path.join(directory, ".git") search_path = os.path.join(directory, "one/two/three") mkdir_p(repository_path) mkdir_p(search_path) repository = find_repository(search_path) assert_equal(directory, repository.working_directory)
def find_repository_returns_git_repository_if_path_is_root_of_git_repository(): with temporary_directory() as directory: mkdir_p(os.path.join(directory, ".git")) repository = find_repository(directory) assert_equal("git", repository.type)
def working_directory_of_git_repository_is_directory_above_hidden_directory(): with temporary_directory() as directory: mkdir_p(os.path.join(directory, ".git")) repository = repository_at(directory) assert_equal(directory, repository.working_directory)
def hg_repository_is_returned_if_path_is_root_of_hg_repository(): with temporary_directory() as directory: mkdir_p(os.path.join(directory, ".hg")) repository = repository_at(directory) assert_equal("hg", repository.type)
def git_repository_is_returned_if_path_is_working_directory_of_git_repository( ): with temporary_directory() as directory: mkdir_p(os.path.join(directory, ".git")) repository = repository_at(directory) assert_equal("git", repository.type)
def git_repository_is_returned_if_path_is_working_directory_of_git_repository(): with temporary_directory() as directory: mkdir_p(os.path.join(directory, ".git")) repository = repository_at(directory) assert_equal("git", repository.type)