gitstats: Moved things around a lot, and made commitTouches fixup nonrelative paths
[git-stats.git] / src / git_stats / branch.py
blob9f1e4f61aec3558eda47d3cf9955cd384b2ec51c
1 #!/usr/bin/env python
3 from git_python import Git
5 def branchContains(branch, commit):
6 """Returns whether the specified branch contains the specified commit.
8 Params:
9 branch: The branch.
10 commit: The commit.
12 Returns:
13 Whether the branch contains the commit.
14 """
16 git = Git(".")
17 arg = branch + ".." + commit
18 result = git.rev_list(arg)
20 if result:
21 # If there is a difference between these sets, the commit is not in the branch
22 return False
23 else:
24 # There is no difference between the two, thus the branch contains the commit
25 return True
27 def dispatch():
28 pass