summaryrefslogtreecommitdiff
path: root/git/refs
diff options
context:
space:
mode:
Diffstat (limited to 'git/refs')
-rw-r--r--git/refs/log.py8
-rw-r--r--git/refs/symbolic.py8
2 files changed, 10 insertions, 6 deletions
diff --git a/git/refs/log.py b/git/refs/log.py
index 7249aec5..3bc42801 100644
--- a/git/refs/log.py
+++ b/git/refs/log.py
@@ -235,7 +235,8 @@ class RefLog(list, Serializable):
"""Append a new log entry to the revlog at filepath.
:param config_reader: configuration reader of the repository - used to obtain
- user information. May be None
+ user information. May also be an Actor instance identifying the committer directly.
+ May also be None
:param filepath: full path to the log file
:param oldbinsha: binary sha of the previous commit
:param newbinsha: binary sha of the current commit
@@ -249,8 +250,9 @@ class RefLog(list, Serializable):
raise ValueError("Shas need to be given in binary format")
#END handle sha type
assure_directory_exists(filepath, is_file=True)
- entry = RefLogEntry((bin_to_hex(oldbinsha), bin_to_hex(newbinsha), Actor.committer(config_reader), (int(time.time()), time.altzone), message))
-
+ committer = isinstance(config_reader, Actor) and config_reader or Actor.committer(config_reader)
+ entry = RefLogEntry((bin_to_hex(oldbinsha), bin_to_hex(newbinsha), committer, (int(time.time()), time.altzone), message))
+
lf = LockFile(filepath)
lf._obtain_lock_or_raise()
diff --git a/git/refs/symbolic.py b/git/refs/symbolic.py
index 9f9eb9f5..eb11627d 100644
--- a/git/refs/symbolic.py
+++ b/git/refs/symbolic.py
@@ -355,9 +355,11 @@ class SymbolicReference(object):
:param newbinsha: The sha the ref points to now. If None, our current commit sha
will be used
:return: added RefLogEntry instance"""
- return RefLog.append_entry(self.repo.config_reader(), RefLog.path(self), oldbinsha,
- (newbinsha is None and self.commit.binsha) or newbinsha,
- message)
+ # NOTE: we use the committer of the currently active commit - this should be
+ # correct. See https://github.com/gitpython-developers/GitPython/pull/146
+ return RefLog.append_entry(self.commit.committer, RefLog.path(self), oldbinsha,
+ (newbinsha is None and self.commit.binsha) or newbinsha,
+ message)
def log_entry(self, index):
""":return: RefLogEntry at the given index