src/MSBuild/Packaging/GitVersionCache/0/src/Utils/DirectoryUtils.cs
/// <summary>
/// Get the absolute directory path of file above beginning from the parent directory of <paramref name="directory"/>, unless <paramref name="includePassedDirectory"/> is true.
/// </summary>
Get the absolute directory path of file above beginning from the parent directory of , unless  is true.
Get the absolute directory path of file above beginning from the parent directory of unless is true .
public static DirectoryInfo GetDirectoryOfFileAbove(string fileNameWithExtension, DirectoryInfo directory, bool includePassedDirectory = false)
        {
            directory = directory ?? throw new ArgumentNullException(nameof(directory));
            if (!includePassedDirectory) {
                directory = directory.Parent;
            }
            for (; ; ) {
                if (directory == null) {
                    return null;
                }
                var rootMarkerFile = Path.Combine(directory.FullName, fileNameWithExtension);
                if (File.Exists(rootMarkerFile)) {
                    return directory;
                } else {
                    directory = directory.Parent;
                }
            }
        }
public static DirectoryInfo GetDirectoryOfFileAbove ( string fileNameWithExtension , DirectoryInfo directory , bool includePassedDirectory = false ) { directory = directory ?? throw new ArgumentNullException ( nameof ( directory ) ) ; if ( ! includePassedDirectory ) { directory = directory . Parent ; } for ( ; ; ) { if ( directory == null ) { return null ; } var rootMarkerFile = Path . Combine ( directory . FullName , fileNameWithExtension ) ; if ( File . Exists ( rootMarkerFile ) ) { return directory ; } else { directory = directory . Parent ; } } }
Get the absolute directory path of file above beginning from the parent directory of , unless  is true.
Get the absolute directory path of file above beginning from the parent directory of unless is true .
fileNameWithExtension
string
directory
DirectoryInfo
includePassedDirectory
bool