23
23
get_user_id ,
24
24
parse_date ,
25
25
Actor ,
26
- altz_to_utctz_str
26
+ altz_to_utctz_str ,
27
27
parse_actor_and_date
28
28
)
29
29
from time import (
30
30
time ,
31
31
altzone
32
32
)
33
+ import os
33
34
34
35
__all__ = ('Commit' , )
35
36
@@ -76,7 +77,7 @@ def __init__(self, repo, binsha, tree=None, author=None, authored_date=None, aut
76
77
:param parents: tuple( Commit, ... )
77
78
is a tuple of commit ids or actual Commits
78
79
:param tree: Tree
79
- 20 byte tree sha
80
+ Tree object
80
81
:param author: Actor
81
82
is the author string ( will be implicitly converted into an Actor object )
82
83
:param authored_date: int_seconds_since_epoch
@@ -103,7 +104,7 @@ def __init__(self, repo, binsha, tree=None, author=None, authored_date=None, aut
103
104
:note: Timezone information is in the same format and in the same sign
104
105
as what time.altzone returns. The sign is inverted compared to git's
105
106
UTC timezone."""
106
- super (Commit ,self ).__init__ (repo , sha )
107
+ super (Commit ,self ).__init__ (repo , binsha )
107
108
self ._set_self_from_args_ (locals ())
108
109
109
110
@classmethod
@@ -227,14 +228,14 @@ def _iter_from_process_or_stream(cls, repo, proc_or_stream):
227
228
line = readline ()
228
229
if not line :
229
230
break
230
- sha = line .strip ()
231
- if len (sha ) > 40 :
231
+ hexsha = line .strip ()
232
+ if len (hexsha ) > 40 :
232
233
# split additional information, as returned by bisect for instance
233
- sha , rest = line .split (None , 1 )
234
+ hexsha , rest = line .split (None , 1 )
234
235
# END handle extra info
235
236
236
- assert len (sha ) == 40 , "Invalid line: %s" % sha
237
- yield Commit (repo , sha )
237
+ assert len (hexsha ) == 40 , "Invalid line: %s" % hexsha
238
+ yield Commit (repo , hex_to_bin ( hexsha ) )
238
239
# END for each line in stream
239
240
240
241
@@ -282,7 +283,7 @@ def create_from_tree(cls, repo, tree, message, parent_commits=None, head=False):
282
283
283
284
# COMMITER AND AUTHOR INFO
284
285
cr = repo .config_reader ()
285
- env = environ
286
+ env = os . environ
286
287
default_email = get_user_id ()
287
288
default_name = default_email .split ('@' )[0 ]
288
289
0 commit comments