Skip to content

Commit

Permalink
check status before pull
Browse files Browse the repository at this point in the history
  • Loading branch information
Scstechr committed Oct 3, 2019
1 parent 96685ad commit ff2d76b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/git/commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ def Commit():
commit_message = prompt("Commit Message [v:vim mode]")
if commit_message.count('`'):
warning(
'{M}{BL}`{M}{R} is not acceptable in this mode.')
if confirm('Replace {M}{BL}`{M}{C} with {M}{BL}\'{M}{C}'):
f'{M}{BL}`{M}{R} is not acceptable in this mode.')
if confirm(f'Replace {M}{BL}`{M}{C} with {M}{BL}\'{M}{C}'):
commit_message = commit_message.replace('`', "'")
warning(
'{M}{BL}`{M}{R} is now replaced with {M}{BL}\'{R}...')
f'{M}{BL}`{M}{R} is now replaced with {M}{BL}\'{R}...')
else:
warning('Now entering vim mode...')
commit_message = 'v'
Expand Down
16 changes: 15 additions & 1 deletion src/git/pull.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
from ..issues import execute

def Pull(remote, branch):
execute([f'git pull {remote} {branch}'])
if not Status():
execute([f'git pull {remote} {branch}'])
else:
execute([f'git diff --stat'])
print(
f'\nTheres some changes in branch {br(current_branch)}.')
qs = [f'Commit changes of branch {br(current_branch)}']
qs.append(f'Stash changes of branch {br(current_branch)} ')
answer = getAnswer(qs)
if answer == 1:
execute([f'git add .', f'git diff --stat'])
Commit()
elif answer == 2:
execute([f'git stash'])
execute([f'git pull {remote} {branch}'])

0 comments on commit ff2d76b

Please sign in to comment.