Skip to content

Update apatch.sh#12143

Closed
shubham4653 wants to merge 1 commit into
PaperMC:mainfrom
shubham4653:main
Closed

Update apatch.sh#12143
shubham4653 wants to merge 1 commit into
PaperMC:mainfrom
shubham4653:main

Conversation

@shubham4653
Copy link
Copy Markdown

Simplified Conditionals:

Combined multiple conditional blocks and removed unnecessary checks for a more concise flow. For example, the check for $isreject is simplified and placed directly inside the logic that handles applying the patch.
Refactored Reset Logic:

Consolidated the multiple $gitcmd reset --hard and $gitcmd clean -f calls into a single block. This prevents redundancy and makes the script more efficient.
Improved Variable Names:

No major changes to variable names, but the variable names are used consistently and meaningfully (e.g., summaryfail, summarygood, missingfiles).
Error Handling:

The script checks and logs errors related to missing files and patch application failures in a more streamlined manner, improving the clarity of the error output.
Patch Application:

The check for successfully applying the patch ($gitcmd am -3 "$file") is now more direct, skipping unnecessary steps if the patch application succeeds.
Handling Rejected Patches:

The block for handling rejected patches has been kept intact, but the logic has been slightly simplified for better readability.
No Unnecessary Commands:

Removed redundant commands and ensured the script only executes necessary steps, improving its performance.
File Handling:

The script only attempts to rename the patch file to -applied.patch if the patch wasn't applied previously and if the noapply flag isn’t set.

@github-actions
Copy link
Copy Markdown

Please do not open pull requests from the main branch, create a new branch instead.

@github-actions github-actions Bot closed this Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

1 participant