示例#1
0
def _perform_git_commit(filename, git_commit, git_message):
    if git_commit and git.is_git():
        reset('git')  # resets git commit info

        git.commit(git_message)
        log('Git repository identified. Performing git commit...')

        git_info = {
            'repository': git.get_remote(),
            'commit': git.get_current_commit(),
            'filename': filename,
            'path': git.get_relative_path(),
            'branch': git.get_branch()
        }
        log_git(git_info, verbose=False)
示例#2
0
    def test_get_relative_path(self):
        expected_result = "nested/folder/deep"

        self.assertEqual(get_relative_path(), expected_result)
示例#3
0
def test_get_relative_path():
    with mock_git_repo():
        os.makedirs("nested/folder/deep")
        os.chdir("nested/folder/deep")

        assert get_relative_path() == "nested/folder/deep"