From 16f500a92daa52eea52716312fede3c311989d95 Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Fri, 7 Oct 2022 21:36:30 -0400 Subject: [PATCH] "Update push_git.py" --- scripts/push_git.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/scripts/push_git.py b/scripts/push_git.py index 66cb042..3ea7bc5 100644 --- a/scripts/push_git.py +++ b/scripts/push_git.py @@ -16,8 +16,6 @@ def get_yes_no_answer(question: str, error_msg: str = "ERROR: Malformed input!") print(f"{question} (y,n): ", end="") ans = input().lower().strip() - print(f"Input: \"{ans}\""); - if ans == "y": return True elif ans == "n": @@ -78,7 +76,7 @@ def stage_git_changes(repo: Repo): # TODO: Check for the staged changes also diff = repo.index.diff(None) - if len(diff) == 0: + """ if len(diff) == 0: diff = repo.index.diff("HEAD") if len(diff) == 0: @@ -86,9 +84,11 @@ def stage_git_changes(repo: Repo): exit() else: print("All changes are already staged...") - return + return """ - print("Git diff:") + """ print("Git diff:") + status = repo.git.status() + print(status) for item in diff: if item.deleted_file: print(f" D - {item.a_path}") @@ -105,13 +105,16 @@ def stage_git_changes(repo: Repo): else: print(f" C - {item.a_path}") - file_diff_list.append(os.path.join(repo.working_tree_dir, item.a_path)) + file_diff_list.append(os.path.join(repo.working_tree_dir, item.a_path)) """ - ans = get_yes_no_answer("Stage entire diff?") + ans = get_yes_no_answer("Stage all changes?") if ans: - for diff in file_diff_list: - repo.git.add(diff) + """ for diff in file_diff_list: + repo.git.add(diff) """ + repo.git.add(".") + status = repo.git.status() + print(status) print("Staged all changes") else: