I'm using Pygit2 to run certain operations within the repo I'm working on.
If my code file is not at the root of the repo, how can I get the path of the repo from anywhere within the repo?
I can do the below in case the function is called from root, but how to do it if I run it from anywhere within the repository code?
$ cd /home/test/Desktop/code/Project
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
$ ipython3
In [1]: import os, pygit2
In [2]: repo = pygit2.Repository(os.getcwd())