def git(embed_data): ''' Git fixture that gives us an instance of git, plus some configurations for test data repositories ''' result = Git() result.remote = embed_data['remote.git'] result.cloned_remote = embed_data['cloned_remote'] result.Clone(result.remote, result.cloned_remote) result.Execute('config --local user.name "test"', result.cloned_remote) result.Execute('config --local user.email "*****@*****.**"', result.cloned_remote) result.Execute('config --local log.date iso', result.cloned_remote) result.Execute('config --local commit.date iso', result.cloned_remote) return result
def GetFilenames(cwd): from gitit.git import Git git = Git.GetSingleton() working_dir = git.GetWorkingDir(cwd) staged_filenames = git.Execute( 'diff --name-only --diff-filter=ACM --staged', repo_path=working_dir) changed_filenames = git.Execute( 'diff --name-only --diff-filter=ACM', repo_path=working_dir) r_filenames = staged_filenames + changed_filenames r_filenames = set(r_filenames) r_filenames = sorted(r_filenames) r_filenames = _FilterFilenames(r_filenames) r_filenames = [working_dir + '/' + i for i in r_filenames] return r_filenames
def git(embed_data): result = Git() result.remote = embed_data['remote.git'] result.cloned_remote = embed_data['cloned_remote'] result.Clone(result.remote, result.cloned_remote) return result