Update apatch.sh#12143
Closed
shubham4653 wants to merge 1 commit into
Closed
Conversation
|
Please do not open pull requests from the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.