From: Shane Jaroch Date: Sat, 17 Jan 2026 06:38:39 +0000 (-0500) Subject: lint/fixes X-Git-Url: https://git.nutra.tk/v1?a=commitdiff_plain;h=52096f28fafc3c0a5a92a88b238b4d6d0a6fe1e9;p=gamesguru%2Fgit-remote-gcrypt.git lint/fixes --- diff --git a/completions/gen_docs.sh b/completions/gen_docs.sh index 55b83b3..d73b41b 100755 --- a/completions/gen_docs.sh +++ b/completions/gen_docs.sh @@ -57,9 +57,8 @@ CLEAN_FLAGS_RAW=$(echo "$RAW_HELP" | grep "^ clean -" | awk '{ CLEAN_FLAGS_BASH=$(echo "$CLEAN_FLAGS_RAW" | tr '\n' ' ' | sed 's/ */ /g; s/ $//') # For Zsh: Generate proper spec strings -CLEAN_FLAGS_ZSH="" # Use while read loop to handle lines safely -echo "$CLEAN_FLAGS_RAW" | while read -r line; do +CLEAN_FLAGS_ZSH=$(echo "$CLEAN_FLAGS_RAW" | while read -r line; do [ -z "$line" ] && continue # line is "-f --force" or "--hard" # simple split @@ -93,15 +92,12 @@ echo "$CLEAN_FLAGS_RAW" | while read -r line; do else printf " %s'%s'" "$fspec" "$desc" fi -done >.zsh_flags_tmp -CLEAN_FLAGS_ZSH=$(cat .zsh_flags_tmp) -rm .zsh_flags_tmp +done | tr '\n' ' ') # For Fish # We need to turn "-f --force" into: -s f -l force # And "--hard" into: -l hard -CLEAN_FLAGS_FISH="" -echo "$CLEAN_FLAGS_RAW" | while read -r line; do +CLEAN_FLAGS_FISH=$(echo "$CLEAN_FLAGS_RAW" | while read -r line; do [ -z "$line" ] && continue short="" @@ -139,9 +135,7 @@ echo "$CLEAN_FLAGS_RAW" | while read -r line; do cmd="$cmd -d 'Flag';" printf "%s\n" "$cmd" -done >.fish_tmp -CLEAN_FLAGS_FISH=$(cat .fish_tmp) -rm .fish_tmp +done) # 3. Generate README echo "Generating $README_OUT..." diff --git a/tests/manual_test_clean_local.sh b/tests/manual_test_clean_local.sh index 2e37140..4328bc6 100755 --- a/tests/manual_test_clean_local.sh +++ b/tests/manual_test_clean_local.sh @@ -1,5 +1,7 @@ #!/bin/sh set -e +export GIT_CONFIG_GLOBAL=/dev/null +export GIT_CONFIG_SYSTEM=/dev/null # Setup test environment echo "Setting up test environment..." @@ -17,7 +19,7 @@ mkdir -p "$REMOTE_DIR" # Initialize repo cd "$REPO_DIR" -git init +git -c init.defaultBranch=master init git config user.email "you@example.com" git config user.name "Your Name" @@ -64,7 +66,7 @@ gpg --batch --passphrase "" --quick-generate-key "Test " # Initialize REMOTE_DIR as a bare git repo so gcrypt treats it as a git backend (gitception) # This is required to trigger gitception_remove -git init --bare "$REMOTE_DIR" +git -c init.defaultBranch=master init --bare "$REMOTE_DIR" # Configure remote git remote add origin "gcrypt::$REMOTE_DIR" @@ -77,8 +79,9 @@ git config advice.defaultBranchName false export PATH="$PROJECT_ROOT:$PATH" echo "Pushing to remote..." -# Explicitly use +master to ensure 'force' is detected by gcrypt to allow init -git push origin +master +# Explicitly use +HEAD:master to ensure 'force' is detected by gcrypt. +# Using HEAD:master ensures we push whatever branch 'git init' created (main/master) to 'master' on remote. +git push origin +HEAD:master # Create garbage on remote cd "$TEST_DIR" @@ -86,10 +89,14 @@ git clone "$REMOTE_DIR" raw_remote_clone cd raw_remote_clone git checkout master || git checkout -b master +# Add multiple garbage files # Add multiple garbage files echo "garbage 1" >garbage1.txt echo "garbage 2" >garbage2.txt git add garbage1.txt garbage2.txt +# Configure identity for this clone to avoid global config interference +git config user.email "garbage@maker.com" +git config user.name "Garbage Maker" git commit -m "Add garbage files" git push origin master