From 0ac2386449a4a2f3bfa42bbd2ec34b8f2a47f0d3 Mon Sep 17 00:00:00 2001 From: LeeZeHao Date: Wed, 29 Oct 2025 18:02:24 +0800 Subject: [PATCH 1/3] Add fetch_merge.py skeleton --- hands_on/fetch_merge.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 hands_on/fetch_merge.py diff --git a/hands_on/fetch_merge.py b/hands_on/fetch_merge.py new file mode 100644 index 0000000..04f6d0b --- /dev/null +++ b/hands_on/fetch_merge.py @@ -0,0 +1,9 @@ +from exercise_utils.cli import run_command +from exercise_utils.gitmastery import create_start_tag + +__requires_git__ = True +__requires_github__ = True + + +def download(verbose: bool): + pass From 0e351d2f63ac6e1e084a41bf286937096132b6f0 Mon Sep 17 00:00:00 2001 From: LeeZeHao Date: Wed, 29 Oct 2025 18:08:53 +0800 Subject: [PATCH 2/3] Add download for hp-fetch-merge --- hands_on/fetch_merge.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hands_on/fetch_merge.py b/hands_on/fetch_merge.py index 04f6d0b..1b8d211 100644 --- a/hands_on/fetch_merge.py +++ b/hands_on/fetch_merge.py @@ -1,3 +1,5 @@ +import os + from exercise_utils.cli import run_command from exercise_utils.gitmastery import create_start_tag @@ -6,4 +8,11 @@ def download(verbose: bool): + os.makedirs("samplerepo-finances") + # Clone the samplerepo-finances repo + run_command(["git", "clone", "https://github.com/git-mastery/samplerepo-finances.git"], verbose) + os.chdir("samplerepo-finances") + # Change the remote origin to point to samplerepo-finances-2 + run_command(["git", "remote", "set-url", "origin", "https://github.com/git-mastery/samplerepo-finances-2.git"], verbose) + pass From 8518cc5376dc1334156918e853edac584d720cc8 Mon Sep 17 00:00:00 2001 From: LeeZeHao Date: Mon, 10 Nov 2025 22:12:49 +0800 Subject: [PATCH 3/3] Implement suggested coding convention changes --- hands_on/fetch_merge.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/hands_on/fetch_merge.py b/hands_on/fetch_merge.py index 1b8d211..18999dc 100644 --- a/hands_on/fetch_merge.py +++ b/hands_on/fetch_merge.py @@ -4,15 +4,11 @@ from exercise_utils.gitmastery import create_start_tag __requires_git__ = True -__requires_github__ = True +__requires_github__ = False def download(verbose: bool): os.makedirs("samplerepo-finances") - # Clone the samplerepo-finances repo - run_command(["git", "clone", "https://github.com/git-mastery/samplerepo-finances.git"], verbose) + run_command(["git", "clone", "https://github.com/git-mastery/samplerepo-finances.git"], verbose) os.chdir("samplerepo-finances") - # Change the remote origin to point to samplerepo-finances-2 - run_command(["git", "remote", "set-url", "origin", "https://github.com/git-mastery/samplerepo-finances-2.git"], verbose) - - pass + run_command(["git", "remote", "set-url", "origin", "https://github.com/git-mastery/samplerepo-finances-2.git"], verbose)