Skip to content

Faster fast-forward #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions PyGitUp/gitup.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,12 @@ def rebase_all_branches(self):

continue # Do not do anything

fast_fastforward = False
if base == branch.commit.hexsha:
print(colored('fast-forwarding...', 'yellow'), end='')
self.states.append('fast-forwarding')
# Don't fast fast-forward the currently checked-out branch
fast_fastforward = (branch.name != self.repo.active_branch.name)

elif not self.settings['rebase.auto']:
print(colored('diverged', 'red'))
Expand All @@ -286,8 +289,11 @@ def rebase_all_branches(self):
print()

self.log(branch, target)
self.git.checkout(branch.name)
self.git.rebase(target)
if fast_fastforward:
branch.commit = target.commit
else:
self.git.checkout(branch.name)
self.git.rebase(target)

def fetch(self):
"""
Expand Down