The version control system won't checkout changed assets when using AssetDatabase.SaveAssetIfDirty.

When using the AssetDatabase.SaveAssetIfDirty method to save modified assets, the version control system will not automatically check out the modified assets. However, if you use the AssetDatabase.SaveAssets method, it will automatically check out the modified assets.

[MenuItem("Test/Test Version Control Checkout")]
private static void TestVersionControlCheckout()
{
    var asset = LoadScriptableObject(); // load an asset
    asset.stringField += "_NewContent"; // make some changes
    EditorUtility.SetDirty(asset);
    // AssetDatabase.SaveAssets(); // ok, will checkout the asset
    AssetDatabase.SaveAssetIfDirty(asset); // not ok, will not checkout the asset
}

Hi Solarian - that does indeed appear to be a bug. Thank you for bringing it to our attention! I will get it set up for processing internally.

Hi @unity_chris , thank you for your reply. May I ask if you could share the issue tracker link for this problem (if available)?

Hi - sorry I missed your reply. Here it is :slight_smile: : Unity Issue Tracker - AssetDatabase.SaveAssetIfDirty does not automatically check out assets

Thank you!