I need to check if branch I'm interested is merged to another branch.
With gitpython
, I can use its git command object like:
import git
g = git.Git('/path/to/git/repo')
g.branch("--no-merged", "master")
Out[273]: u'* new\n test'
So it outputs correct branches, but format it returns is kind of not really good. Now I need to parse string and find the branch I'm interested.
I was thinking if the same can be accomplished using:
repo = git.Repo('/path/to/git/repo')
# Check branches using `repo` object as starting point?
With repo
object, there are many useful methods that can retrieve useful information which is already parsed into objects, but I did not find how to do same thing with repo
object (if it is possible at all?).