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

Git autofix #12230

Merged
merged 4 commits into from
Aug 7, 2023
Merged

Git autofix #12230

merged 4 commits into from
Aug 7, 2023

Conversation

wfjsw
Copy link
Contributor

@wfjsw wfjsw commented Aug 1, 2023

Description

  • Attempt to fix the workspace if git checkout fails.

Screenshots/videos:

f9a1102a71bd7871804b383df583cf4e

Checklist:

@wfjsw wfjsw requested a review from AUTOMATIC1111 as a code owner August 1, 2023 03:40
@AUTOMATIC1111
Copy link
Owner

One obvious thing is that some code here is copy-pasted and should be put into a function instead...

Otherwise, we are running those two git commands here whenever any exception occurs. Do they fix any possible problem?

@wfjsw
Copy link
Contributor Author

wfjsw commented Aug 1, 2023

It fixes problems caused by:

  • missing objects
  • broken packfile
  • possibly broken ref

that's frequently seen during a power failure (or some hard drive problem)

I'm aware that there is a fair amount of copy-pasty but not sure how to improve (lambda probably?)

@wfjsw
Copy link
Contributor Author

wfjsw commented Aug 1, 2023

An alternative way would be removing the folder from repositories altogether and attempt a re-clone. still better than doing nothing imo.

@AUTOMATIC1111 AUTOMATIC1111 merged commit 5cf37ca into AUTOMATIC1111:dev Aug 7, 2023
AUTOMATIC1111 added a commit that referenced this pull request Aug 7, 2023
@w-e-w w-e-w mentioned this pull request Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants