@@ -50,11 +50,11 @@ class PushInfo(GitdbPushInfo):
50
50
info.remote_ref_string # path to the remote reference located on the remote side
51
51
info.remote_ref # Remote Reference on the local side corresponding to
52
52
# the remote_ref_string. It can be a TagReference as well.
53
- info.old_commit # commit at which the remote_ref was standing before we pushed
53
+ info.old_commit_binsha # binary sha at which the remote_ref was standing before we pushed
54
54
# it to local_ref.commit. Will be None if an error was indicated
55
55
info.summary # summary line providing human readable english text about the push
56
56
"""
57
- __slots__ = ('local_ref' , 'remote_ref_string' , 'flags' , 'old_commit ' , '_remote' , 'summary' )
57
+ __slots__ = ('local_ref' , 'remote_ref_string' , 'flags' , 'old_commit_binsha ' , '_remote' , 'summary' )
58
58
59
59
_flag_map = { 'X' : GitdbPushInfo .NO_MATCH ,
60
60
'-' : GitdbPushInfo .DELETED , '*' : 0 ,
@@ -63,14 +63,14 @@ class PushInfo(GitdbPushInfo):
63
63
'=' : GitdbPushInfo .UP_TO_DATE ,
64
64
'!' : GitdbPushInfo .ERROR }
65
65
66
- def __init__ (self , flags , local_ref , remote_ref_string , remote , old_commit = None ,
66
+ def __init__ (self , flags , local_ref , remote_ref_string , remote , old_commit_binsha = None ,
67
67
summary = '' ):
68
68
""" Initialize a new instance """
69
69
self .flags = flags
70
70
self .local_ref = local_ref
71
71
self .remote_ref_string = remote_ref_string
72
72
self ._remote = remote
73
- self .old_commit = old_commit
73
+ self .old_commit_binsha = old_commit_binsha
74
74
self .summary = summary
75
75
76
76
@property
@@ -111,7 +111,7 @@ def _from_line(cls, remote, line):
111
111
from_ref = Reference .from_path (remote .repo , from_ref_string )
112
112
113
113
# commit handling, could be message or commit info
114
- old_commit = None
114
+ old_commit_binsha = None
115
115
if summary .startswith ('[' ):
116
116
if "[rejected]" in summary :
117
117
flags |= cls .REJECTED
@@ -134,10 +134,10 @@ def _from_line(cls, remote, line):
134
134
split_token = ".."
135
135
old_sha , new_sha = summary .split (' ' )[0 ].split (split_token )
136
136
# have to use constructor here as the sha usually is abbreviated
137
- old_commit = remote .repo .commit (old_sha )
137
+ old_commit_binsha = remote .repo .commit (old_sha )
138
138
# END message handling
139
139
140
- return PushInfo (flags , from_ref , to_ref_string , remote , old_commit , summary )
140
+ return PushInfo (flags , from_ref , to_ref_string , remote , old_commit_binsha , summary )
141
141
142
142
143
143
class FetchInfo (GitdbFetchInfo ):
@@ -151,10 +151,10 @@ class FetchInfo(GitdbFetchInfo):
151
151
# i.e. info.flags & info.REJECTED
152
152
# is 0 if ref is FETCH_HEAD
153
153
info.note # additional notes given by git-fetch intended for the user
154
- info.old_commit # if info.flags & info.FORCED_UPDATE|info.FAST_FORWARD,
154
+ info.old_commit_binsha # if info.flags & info.FORCED_UPDATE|info.FAST_FORWARD,
155
155
# field is set to the previous location of ref, otherwise None
156
156
"""
157
- __slots__ = ('ref' ,'old_commit ' , 'flags' , 'note' )
157
+ __slots__ = ('ref' ,'old_commit_binsha ' , 'flags' , 'note' )
158
158
159
159
# %c %-*s %-*s -> %s (%s)
160
160
re_fetch_result = re .compile ("^\s*(.) (\[?[\w\s\.]+\]?)\s+(.+) -> ([/\w_\+\.-]+)( \(.*\)?$)?" )
@@ -166,14 +166,14 @@ class FetchInfo(GitdbFetchInfo):
166
166
'=' : GitdbFetchInfo .HEAD_UPTODATE ,
167
167
' ' : GitdbFetchInfo .FAST_FORWARD }
168
168
169
- def __init__ (self , ref , flags , note = '' , old_commit = None ):
169
+ def __init__ (self , ref , flags , note = '' , old_commit_binsha = None ):
170
170
"""
171
171
Initialize a new instance
172
172
"""
173
173
self .ref = ref
174
174
self .flags = flags
175
175
self .note = note
176
- self .old_commit = old_commit
176
+ self .old_commit_binsha = old_commit_binsha
177
177
178
178
def __str__ (self ):
179
179
return self .name
@@ -250,7 +250,7 @@ def _from_line(cls, repo, line, fetch_line):
250
250
# END control char exception hanlding
251
251
252
252
# parse operation string for more info - makes no sense for symbolic refs
253
- old_commit = None
253
+ old_commit_binsha = None
254
254
if isinstance (remote_local_ref , Reference ):
255
255
if 'rejected' in operation :
256
256
flags |= cls .REJECTED
@@ -262,11 +262,11 @@ def _from_line(cls, repo, line, fetch_line):
262
262
split_token = '...'
263
263
if control_character == ' ' :
264
264
split_token = split_token [:- 1 ]
265
- old_commit = repo .rev_parse (operation .split (split_token )[0 ])
265
+ old_commit_binsha = repo .rev_parse (operation .split (split_token )[0 ])
266
266
# END handle refspec
267
267
# END reference flag handling
268
268
269
- return cls (remote_local_ref , flags , note , old_commit )
269
+ return cls (remote_local_ref , flags , note , old_commit_binsha )
270
270
271
271
272
272
class GitCmdObjectDB (LooseObjectDB , TransportDBMixin ):
0 commit comments