Skip to content

Commit 812e975

Browse files
pipcl.py: git_get(): fix handling of --tag, and improve clearing of current checkout.
1 parent 8dd3d11 commit 812e975

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pipcl.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2108,7 +2108,7 @@ def git_get(
21082108
branch = next(args)
21092109
tag = None
21102110
elif arg == '--tag':
2111-
tag == next(args)
2111+
tag = next(args)
21122112
branch = None
21132113
else:
21142114
remote = arg
@@ -2123,7 +2123,7 @@ def do_update():
21232123
# This seems to pull in the entire repository.
21242124
log0(f'do_update(): attempting to update {local=}.')
21252125
# Remove any local changes.
2126-
run(f'cd {local} && git checkout .', env_extra=env_extra)
2126+
run(f'cd {local} && git reset --hard', env_extra=env_extra)
21272127
if tag:
21282128
# `-u` avoids `fatal: Refusing to fetch into current branch`.
21292129
# Using '+' and `revs/tags/` prefix seems to avoid errors like:

0 commit comments

Comments
 (0)