Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert --ignore-dirty-git addition #179

Merged
merged 1 commit into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions testing/tests/ignore-dirty

This file was deleted.

8 changes: 1 addition & 7 deletions testing/tests/install-invalid
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ mkdir ./packages/notagitrepo
zkg --config=$CONFIG install --force ./packages/notagitrepo

mkdir ./packages/dirtyrepo
( cd ./packages/dirtyrepo && \
git init . && \
touch README && \
cp ${PACKAGES}/foo/zkg.meta zkg.meta && \
git add README zkg.meta && \
git commit -m "Initial commit")
( cd ./packages/dirtyrepo && git init . && touch README && git add README && git commit -m "Initial commit")
echo README > ./packages/dirtyrepo/README

zkg --config=$CONFIG install --force ./packages/dirtyrepo
31 changes: 5 additions & 26 deletions zkg
Original file line number Diff line number Diff line change
Expand Up @@ -354,12 +354,12 @@ def is_local_git_repo_dirty(git_url):
return repo.is_dirty(untracked_files=True)


def check_local_git_repo(git_url, allow_dirty):
def check_local_git_repo(git_url):
if is_local_git_repo_url(git_url):
if not is_local_git_repo(git_url):
print_error(f"error: path {git_url} is not a git repository")
return False
if not allow_dirty and is_local_git_repo_dirty(git_url):
if is_local_git_repo_dirty(git_url):
print_error(f"error: local git clone at {git_url} is dirty")
return False

Expand Down Expand Up @@ -525,7 +525,7 @@ def cmd_test(manager, args, config, configfile):
package_infos = []

for name in args.package:
if not check_local_git_repo(name, args.ignore_dirty_git):
if not check_local_git_repo(name):
sys.exit(1)

# If the package to be tested is included with Zeek, don't allow
Expand Down Expand Up @@ -602,7 +602,7 @@ def cmd_install(manager, args, config, configfile):
package_infos = []

for name in args.package:
if not check_local_git_repo(name, args.ignore_dirty_git):
if not check_local_git_repo(name):
sys.exit(1)

# Outright prevent installing a package that Zeek has built-in.
Expand Down Expand Up @@ -878,7 +878,7 @@ def cmd_bundle(manager, args, config, configfile):
new_pkgs = []

for name, version in packages:
if not check_local_git_repo(name, args.ignore_dirty_git):
if not check_local_git_repo(name):
sys.exit(1)

if not version:
Expand Down Expand Up @@ -2475,13 +2475,6 @@ def argparser():
" the latest version tag, or if a package has none,"
' the default branch, like "main" or "master".',
)
sub_parser.add_argument(
"--ignore-dirty-git",
action="store_true",
help=(
"Allows installation of packages from 'dirty' git clones instead of failing."
),
)

# install
sub_parser = command_parser.add_parser(
Expand Down Expand Up @@ -2523,13 +2516,6 @@ def argparser():
" the latest version tag, or if a package has none,"
' the default branch, like "main" or "master".',
)
sub_parser.add_argument(
"--ignore-dirty-git",
action="store_true",
help=(
"Allows installation of packages from 'dirty' git clones instead of failing."
),
)
add_uservar_args(sub_parser)

# bundle
Expand Down Expand Up @@ -2587,13 +2573,6 @@ def argparser():
" left blank to indicate that the latest available version should be"
" used.",
)
sub_parser.add_argument(
"--ignore-dirty-git",
action="store_true",
help=(
"Allows installation of packages from 'dirty' git clones instead of failing."
),
)

# unbundle
sub_parser = command_parser.add_parser(
Expand Down
Loading