Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Commit

Permalink
fix: Retry gets correct last constructed message
Browse files Browse the repository at this point in the history
The retry command was using the very first saved commit message. This
has been fixed so that it uses the most recently saved commit message.
  • Loading branch information
nebbles committed Jun 13, 2020
1 parent b240bb1 commit 2b2e7e0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions gitcommit/gitcommit.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,9 +425,9 @@ def run(args):
if len(args) > 0 and args[0] == "retry":
args = args[1:] # consume the "retry" first arg
cm_histories_iter = commit_msg_history.load_history_strings()
last_commit_msg = ""
for last_commit_msg in cm_histories_iter:
pass
last_commit_msg = next(cm_histories_iter, "")
if last_commit_msg == "":
Ansi.print_error("Could not find a previous commit message")
commit_msg = last_commit_msg

if commit_msg == "":
Expand Down Expand Up @@ -493,7 +493,7 @@ def run(args):

def main():
try:
print(sys.argv)
# print(sys.argv)
run(sys.argv[1:])
except KeyboardInterrupt:
print("\nAborted.")

0 comments on commit 2b2e7e0

Please sign in to comment.