Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Asset hash is changed when using autocrlf=true for git and CacheServer not work

Discussion in 'Cache Server' started by Kichang-Kim, Feb 3, 2020.

  1. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    1,008
    Hi. I found that when autocrlf of git is enabled for Unity project, its asset hash is changed and Cache server doesn't work for that assets (is generated duplicated asset cache for LF and CRLF versions)

    The problem is that git automatically changes newline code for "*.meta" files and AssetDatabase.GetAssetDependencyHash() returns different values between LF and CRLF files.

    It seems "by design" because AssetDatabase.GetAssetDependencyHash() uses hash of meta file internally, but is there any solution for this? or should I force that all developers use same newline codes?

    Any ideas are welcome.

    Thanks.