From 202216e2cdb50d0e704682c5f732dfb7c221fbbc Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Mon, 23 Nov 2009 18:49:31 +0100 Subject: remote.fetch: fetchInfo would not provide old_commit information in case of fast_forwards although. Renamed cumbersome 'commit_before_forced_updated' attribute to 'old_commit' to be en par with PushInfo --- lib/git/remote.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'lib/git/remote.py') diff --git a/lib/git/remote.py b/lib/git/remote.py index b1c90bd5..56c6cf96 100644 --- a/lib/git/remote.py +++ b/lib/git/remote.py @@ -255,10 +255,10 @@ class FetchInfo(object): # i.e. info.flags & info.REJECTED # is 0 if ref is SymbolicReference info.note # additional notes given by git-fetch intended for the user - info.commit_before_forced_update # if info.flags & info.FORCED_UPDATE, + info.old_commit # if info.flags & info.FORCED_UPDATE|info.FAST_FORWARD, # field is set to the previous location of ref, otherwise None """ - __slots__ = ('ref','commit_before_forced_update', 'flags', 'note') + __slots__ = ('ref','old_commit', 'flags', 'note') NEW_TAG, NEW_HEAD, HEAD_UPTODATE, TAG_UPDATE, REJECTED, FORCED_UPDATE, \ FAST_FORWARD, ERROR = [ 1 << x for x in range(8) ] @@ -276,7 +276,7 @@ class FetchInfo(object): self.ref = ref self.flags = flags self.note = note - self.commit_before_forced_update = old_commit + self.old_commit = old_commit def __str__(self): return self.name @@ -369,8 +369,11 @@ class FetchInfo(object): flags |= cls.NEW_TAG if 'new branch' in operation: flags |= cls.NEW_HEAD - if '...' in operation: - old_commit = Commit(repo, operation.split('...')[0]) + if '...' in operation or '..' in operation: + split_token = '...' + if control_character == ' ': + split_token = split_token[:-1] + old_commit = Commit(repo, operation.split(split_token)[0]) # END handle refspec # END reference flag handling -- cgit v1.2.1