summaryrefslogtreecommitdiff
path: root/git/repo/base.py
diff options
context:
space:
mode:
Diffstat (limited to 'git/repo/base.py')
-rw-r--r--git/repo/base.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/git/repo/base.py b/git/repo/base.py
index 1df3c547..efb70b37 100644
--- a/git/repo/base.py
+++ b/git/repo/base.py
@@ -1062,3 +1062,14 @@ class Repo(object):
def __repr__(self):
return '<git.Repo "%s">' % self.git_dir
+
+ def currentlyRebasingOn(self):
+ """
+ :return: The hash of the commit which is currently being replayed while rebasing.
+
+ None if we are not currently rebasing.
+ """
+ rebase_head_file = osp.join(self.git_dir, "REBASE_HEAD")
+ if not osp.isfile(rebase_head_file):
+ return None
+ return open(rebase_head_file, "rt").readline().strip()