Skip to content

Commit

Permalink
Fix code check to use git restore
Browse files Browse the repository at this point in the history
  • Loading branch information
norkans7 committed Jul 9, 2020
1 parent d2f4e3f commit 25f4ec0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion code_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ def get_current_msgids():
pot = polib.pofile("locale/en_US/LC_MESSAGES/django.po")
return {e.msgid for e in pot if not e.fuzzy and not e.obsolete}

cmd(f"git restore --staged --worktree locale")

# get the current set of msgids
saved_msgids = get_current_msgids()

Expand All @@ -59,7 +61,7 @@ def get_current_msgids():

# if there are no actual changes to msgids, revert
if not added_msgids and not removed_msgids:
cmd(f"git checkout -- locale")
cmd(f"git restore locale")


if __name__ == "__main__":
Expand Down

0 comments on commit 25f4ec0

Please sign in to comment.