Beispiel #1
0
        public async Task <string> HashAsync(string path, ObjectType type = ObjectType.Blob)
        {
            string content = await FileExtensions.ReadFileAsync(path, Encoding).ConfigureAwait(false);

            string filtered = Filter(content);
            string obj      = _objectFactory.Create(type, filtered).Value;

            string oid = Hash(Encoding.GetBytes(obj));

            string[] split = oid.Split(2);

            await FileExtensions.WriteFileAsync($"{Dir}/objects/{split[0]}/{split[1]}", obj);

            return(oid);
        }