Skip to content

Commit

Permalink
Merge branch 'pr/1352'
Browse files Browse the repository at this point in the history
  • Loading branch information
ethomson committed Jun 24, 2017
2 parents e8ca4e8 + 9cf43a3 commit 72fa368
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
11 changes: 11 additions & 0 deletions LibGit2Sharp/Core/Proxy.cs
Expand Up @@ -3418,6 +3418,17 @@ public static void git_libgit2_opts_set_search_path(ConfigurationLevel level, st
Ensure.ZeroResult(res);
}

/// <summary>
/// Enable or disable the libgit2 cache
/// </summary>
/// <param name="enabled">true to enable the cache, false otherwise</param>
public static void git_libgit2_opts_set_enable_caching(bool enabled)
{
// libgit2 expects non-zero value for true
var res = NativeMethods.git_libgit2_opts((int)LibGitOption.EnableCaching, enabled ? 1 : 0);
Ensure.ZeroResult(res);
}

#endregion

private static ICollection<TResult> git_foreach<T, TResult>(
Expand Down
9 changes: 9 additions & 0 deletions LibGit2Sharp/GlobalSettings.cs
Expand Up @@ -329,5 +329,14 @@ public static void SetStrictHashVerification(bool enabled)
{
Proxy.git_libgit2_opts_enable_strict_hash_verification(enabled);
}

/// <summary>
/// Enable or disable the libgit2 cache
/// </summary>
/// <param name="enabled">true to enable the cache, false otherwise</param>
public static void SetEnableCaching(bool enabled)
{
Proxy.git_libgit2_opts_set_enable_caching(enabled);
}
}
}

0 comments on commit 72fa368

Please sign in to comment.