I'm writing a module that integrates one system with git
. I'm writing tests and want to have test repository inside tests directory, so I could run unittests on it.
Module and project structure looks like this:
myproject/
mymodule/
some_dir/
tests/
__init__.py
testrepo/
/.git
test_some.py
/.git
Now while I'm developing, it is working. I can run tests using testrepo
. Though I noticed, when I committed, git
started treating testrepo
as subproject automatically. So basically it does not track all changes that occurred. If actual code changes, then it recognizes as subproject/submodule change. But if I let say add new branch, those changes are not recognized (unless I would check out to it etc).
So I'm wondering what could be best way to use testrepo
for unittests. I want it to be in source control, so whole structure would be intact with unittests.
If understood correctly from how can I add git submodule into git repo as normal directory? it is not really possible (only by somewhat hacking git name back and forth) to treat sub git repository as normal repository.
So how I could preserve all changes in sub repository, so I would need to just pull myproject
and get testrepo
with all branches etc?
Or I can only use it as real submodule and need to initialize it after cloning myproject
?
Update
If I use testrepo
as real submodule, then my tests stop working, because it is no longer recognized as normal git
repo.