Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/subcommand/commit_subcommand.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <git2.h>
#include <unistd.h>

#include "commit_subcommand.hpp"
#include "../subcommand/commit_subcommand.hpp"
#include "../wrapper/index_wrapper.hpp"
#include "../wrapper/repository_wrapper.hpp"

Expand Down
23 changes: 20 additions & 3 deletions test/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import os
from pathlib import Path
import pytest
import subprocess
from genericpath import exists


# Fixture to run test in current tmp_path
@pytest.fixture
Expand All @@ -15,7 +18,21 @@ def git2cpp_path():
return Path(__file__).parent.parent / 'build' / 'git2cpp'

@pytest.fixture
def rename_git():
os.rename("test/data/status_data/embedded_git/", "test/data/status_data/.git/")
def xtl_clone(git2cpp_path):
url = 'https://github.com/xtensor-stack/xtl.git'
clone_working_dir = 'test/data'

clone_cmd = [git2cpp_path, 'clone', url]
subprocess.run(clone_cmd, capture_output=True, cwd = clone_working_dir, text=True)

yield
os.rename("test/data/status_data/.git/", "test/data/status_data/embedded_git/")

cleanup_cmd = ['rm', '-rf', 'xtl']
subprocess.run(cleanup_cmd, capture_output=True, cwd = clone_working_dir, text=True)

@pytest.fixture
def git_config(git2cpp_path, monkeypatch):
monkeypatch.setenv("GIT_AUTHOR_NAME", "Jane Doe")
monkeypatch.setenv("GIT_AUTHOR_EMAIL", "[email protected]")
monkeypatch.setenv("GIT_COMMITTER_NAME", "Jane Doe")
monkeypatch.setenv("GIT_COMMITTER_EMAIL", "[email protected]")
Empty file added test/data/blank_file.txt
Empty file.
1 change: 0 additions & 1 deletion test/data/status_data/embedded_git/COMMIT_EDITMSG

This file was deleted.

1 change: 0 additions & 1 deletion test/data/status_data/embedded_git/HEAD

This file was deleted.

5 changes: 0 additions & 5 deletions test/data/status_data/embedded_git/config

This file was deleted.

1 change: 0 additions & 1 deletion test/data/status_data/embedded_git/description

This file was deleted.

15 changes: 0 additions & 15 deletions test/data/status_data/embedded_git/hooks/applypatch-msg.sample

This file was deleted.

24 changes: 0 additions & 24 deletions test/data/status_data/embedded_git/hooks/commit-msg.sample

This file was deleted.

174 changes: 0 additions & 174 deletions test/data/status_data/embedded_git/hooks/fsmonitor-watchman.sample

This file was deleted.

8 changes: 0 additions & 8 deletions test/data/status_data/embedded_git/hooks/post-update.sample

This file was deleted.

14 changes: 0 additions & 14 deletions test/data/status_data/embedded_git/hooks/pre-applypatch.sample

This file was deleted.

49 changes: 0 additions & 49 deletions test/data/status_data/embedded_git/hooks/pre-commit.sample

This file was deleted.

13 changes: 0 additions & 13 deletions test/data/status_data/embedded_git/hooks/pre-merge-commit.sample

This file was deleted.

Loading