text: public static IndexCommit FindIndexCommit(Store.Directory dir, string userData){IList<IndexCommit> commits = DirectoryReader.ListCommits(dir);foreach (IndexCommit ic in commits){IDictionary<string, string> map = ic.UserData;string ud = null;if (map != null){map.TryGetValue(USER_DATA, out ud);}if (ud != null && ud.Equals(userData, StringComparison.Ordinal)){return ic;}}throw new IOException("index does not contain commit with userData: " + userData);}