diff options
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | git/repo/base.py | 11 |
2 files changed, 12 insertions, 0 deletions
@@ -33,5 +33,6 @@ Contributors are: -Steven Whitman <ninloot _at_ gmail.com> -Stefan Stancu <stefan.stancu _at_ gmail.com> -César Izurieta <cesar _at_ caih.org> +-Arthur Milchior <arthur _at_ milchior.fr> Portions derived from other open source works and are clearly marked. 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() |