Welcome to mirror list, hosted at ThFree Co, Russian Federation.

SignatureExtensions.cs « LibGit2Sharp - github.com/mono/libgit2sharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7c3f868c8ce36ff140d7a7bb6fa6703357adea76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
using System;
using LibGit2Sharp.Core;

namespace LibGit2Sharp
{
    /// <summary>
    /// Provides helper overloads for a <see cref="Signature"/>
    /// </summary>
    internal static class SignatureExtensions
    {
        /// <summary>
        /// If the signature is null, return the default using configuration values.
        /// </summary>
        /// <param name="signature">The signature to test</param>
        /// <param name="config">The configuration to query for default values</param>
        /// <returns>A valid <see cref="Signature"/></returns>
        public static Signature OrDefault(this Signature signature, Configuration config)
        {
            return signature ?? config.BuildSignature(DateTimeOffset.Now);
        }
    }
}