Skip to content

Commit 589dfcd

Browse files
committed
refactor: make git related commands more accurate
1 parent 456aaaf commit 589dfcd

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

scripts/update-demo.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import os
21
import sys
32
from pathlib import Path
43
from typing import Annotated
@@ -35,16 +34,16 @@ def update_demo(
3534
demo_path: Path = demos_cache_folder / demo_name
3635

3736
current_branch: str = get_current_branch()
38-
current_commit: str = get_current_commit()
37+
template_commit: str = get_current_commit()
3938

4039
_validate_is_feature_branch(branch=current_branch)
4140

4241
last_update_commit: str = _get_last_demo_develop_cruft_update(demo_path=demo_path)
4342

44-
if not is_ancestor(last_update_commit, current_commit):
43+
if not is_ancestor(last_update_commit, template_commit):
4544
raise ValueError(
4645
f"The last update commit '{last_update_commit}' is not an ancestor of the current commit "
47-
f"'{current_commit}'."
46+
f"'{template_commit}'."
4847
)
4948

5049
typer.secho(f"Updating demo project at {demo_path=}.", fg="yellow")
@@ -66,7 +65,7 @@ def update_demo(
6665
)
6766
uv("lock")
6867
git("add", ".")
69-
git("commit", "-m", f"chore: {last_update_commit} -> {current_commit}", "--no-verify")
68+
git("commit", "-m", f"chore: {last_update_commit} -> {template_commit}", "--no-verify")
7069
git("push", "-u", "origin", current_branch)
7170

7271
except Exception as error:

0 commit comments

Comments
 (0)