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

error: add_cacheinfo failed to refresh for path 'packages/react-native-gradle-plugin/gradlew.bat'; merge aborting. #8

Closed
fabOnReact opened this issue Feb 18, 2022 · 3 comments

Comments

@fabOnReact
Copy link
Owner

fabOnReact commented Feb 18, 2022

ISSUE

Merge main in old branch causes the following error

error: add_cacheinfo failed to refresh for path 'packages/react-native-gradle-plugin/gradlew.bat'; merge aborting.
Full Log

image

Current Investigation

  • Reproduces both macos and ubuntu
  • Reproduces on new clone (it is not caused by my fork)
  • Maybe it's caused by the github commit changing the .gitattributes. facebook/react-native@7384471
  • I deleted all .gitconfig settings on macos

Links

Stackoverflow explanation https://stackoverflow.com/a/57199694
PRs facebook/react-native#12800 facebook/react-native#31398 facebook/react-native#31128 facebook/react-native#32160 helium/hotspot-app#944

@fabOnReact

This comment was marked as resolved.

@fabOnReact

This comment was marked as resolved.

@fabOnReact
Copy link
Owner Author

fabOnReact commented Feb 18, 2022

facebook/react-native#31128 (comment)

If you want to see how these files are actually stored:
Remove .gitattributes (so that no conversion happens)

I solved the problem with the following steps:

  1. checkout branch I want to rebase
  2. the branch was already rebased and included commit facebook/react-native@7384471 which brought .gitattributes file in the branch
    The file below triggers the error error: add_cacheinfo failed to refresh for path 'packages/react-native-gradle-plugin/gradlew.bat'; merge aborting. when running git merge master.
-# Windows files should use crlf line endings
-# https://help.github.com/articles/dealing-with-line-endings/
-*.bat text eol=crlf
  1. I remove the .gitattributes files from the branch.
  2. git stops converting the line ending
  3. I merge main branch. .gitattributes files was already removed from main branch with https://github.com/facebook/react-native/pull/31398/files. Git runs the merge without problems. Also no diff because the file already deleted from main.

fabOnReact added a commit to fabOnReact/react-native that referenced this issue Feb 18, 2022
More info at fabOnReact/react-native-notes#8
facebook#31128 (comment)

>If you want to see how these files are actually stored:
>Remove .gitattributes (so that no conversion happens)

I solved the problem with the following steps:

1) checkout branch I want to rebase
2) the branch was already rebased and included commit facebook@7384471 which brought `.gitattributes` file in the branch
    The file below triggers the error `error: add_cacheinfo failed to refresh for path 'packages/react-native-gradle-plugin/gradlew.bat'; merge aborting.` when running `git merge master`.
```
-# Windows files should use crlf line endings
-# https://help.github.com/articles/dealing-with-line-endings/
-*.bat text eol=crlf
```
3) I remove the  `.gitattributes` files from the branch.
4) `git` stops converting the line ending
5) I merge main branch. `.gitattributes` files was already removed from main branch with https://github.com/facebook/react-native/pull/31398/files. Git runs the merge without problems. Also no diff because the file already deleted from main.
fabOnReact added a commit to fabOnReact/react-native that referenced this issue Feb 24, 2022
More info at fabOnReact/react-native-notes#8
facebook#31128 (comment)

>If you want to see how these files are actually stored:
>Remove .gitattributes (so that no conversion happens)

I solved the problem with the following steps:

1) checkout branch I want to rebase
2) the branch was already rebased and included commit facebook@7384471 which brought `.gitattributes` file in the branch
    The file below triggers the error `error: add_cacheinfo failed to refresh for path 'packages/react-native-gradle-plugin/gradlew.bat'; merge aborting.` when running `git merge master`.
```
-# Windows files should use crlf line endings
-# https://help.github.com/articles/dealing-with-line-endings/
-*.bat text eol=crlf
```
3) I remove the  `.gitattributes` files from the branch.
4) `git` stops converting the line ending
5) I merge main branch. `.gitattributes` files was already removed from main branch with https://github.com/facebook/react-native/pull/31398/files. Git runs the merge without problems. Also no diff because the file already deleted from main.
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

No branches or pull requests

1 participant