Merge branch 'commit_by_actor' of https://github.com/firm1/GitPython … · johnwalker/GitPython@7379091 · GitHub
Skip to content

Commit 7379091

Browse files
committed
Merge branch 'commit_by_actor' of https://github.com/firm1/GitPython into firm1-commit_by_actor
2 parents 45eb728 + b6ed8d4 commit 7379091

4 files changed

Lines changed: 29 additions & 6 deletions

File tree

doc/source/tutorial.rst

Lines changed: 4 additions & 1 deletion

git/objects/commit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ def create_from_tree(cls, repo, tree, message, parent_commits=None, head=False,
358358
# as well ...
359359
import git.refs
360360
try:
361-
repo.head.set_commit(new_commit, logmsg="commit: %s" % message)
361+
repo.head.set_commit(new_commit, logmsg=message)
362362
except ValueError:
363363
# head is not yet set to the ref our HEAD points to
364364
# Happens on first commit

git/refs/log.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,20 @@
3232
class RefLogEntry(tuple):
3333

3434
"""Named tuple allowing easy access to the revlog data fields"""
35-
_fmt = "%s %s %s <%s> %i %s\t%s\n"
3635
_re_hexsha_only = re.compile('^[0-9A-Fa-f]{40}$')
3736
__slots__ = tuple()
3837

3938
def __repr__(self):
4039
"""Representation of ourselves in git reflog format"""
4140
act = self.actor
4241
time = self.time
43-
return self._fmt % (self.oldhexsha, self.newhexsha, act.name, act.email,
44-
time[0], altz_to_utctz_str(time[1]), self.message)
42+
return u"{0} {1} {2} <{3}> {4!s} {5}\t{6}\n".format(self.oldhexsha,
43+
self.newhexsha,
44+
act.name,
45+
act.email,
46+
time[0],
47+
altz_to_utctz_str(time[1]),
48+
self.message).encode("utf-8")
4549

4650
@property
4751
def oldhexsha(self):
@@ -267,7 +271,6 @@ def append_entry(cls, config_reader, filepath, oldbinsha, newbinsha, message):
267271

268272
lf = LockFile(filepath)
269273
lf._obtain_lock_or_raise()
270-
271274
fd = open(filepath, 'ab')
272275
try:
273276
fd.write(repr(entry).encode(defenc))

git/test/test_index.py

Lines changed: 17 additions & 0 deletions

0 commit comments

Comments
 (0)