Skip to content

Commit 8b0e48f

Browse files
authored
Merge pull request #2027 from libgit2/fix-remote-redirect-mode
Update RemoteRedirectMode to match git_remote_redirect_t
2 parents 8ae9922 + c157b6a commit 8b0e48f

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

LibGit2Sharp/Core/GitFetchOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ internal class GitFetchOptions
1111
public bool UpdateFetchHead = true;
1212
public TagFetchMode download_tags;
1313
public GitProxyOptions ProxyOptions;
14-
public RemoteRedirectMode FollowRedirects = RemoteRedirectMode.Auto;
14+
public RemoteRedirectMode FollowRedirects = RemoteRedirectMode.Initial;
1515
public GitStrArrayManaged CustomHeaders;
1616
}
1717
}

LibGit2Sharp/Core/GitPushOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ internal class GitPushOptions
99
public int PackbuilderDegreeOfParallelism;
1010
public GitRemoteCallbacks RemoteCallbacks;
1111
public GitProxyOptions ProxyOptions;
12-
public RemoteRedirectMode FollowRedirects = RemoteRedirectMode.Auto;
12+
public RemoteRedirectMode FollowRedirects = RemoteRedirectMode.Initial;
1313
public GitStrArrayManaged CustomHeaders;
1414
}
1515
}

LibGit2Sharp/RemoteRedirectMode.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
namespace LibGit2Sharp
22
{
33
/// <summary>
4-
/// Remote redirection settings; wehther redirects to another
4+
/// Remote redirection settings; whether redirects to another
55
/// host are permitted. By default, git will follow a redirect
66
/// on the initial request (`/info/refs`) but not subsequent
77
/// requests.
@@ -12,17 +12,17 @@ public enum RemoteRedirectMode
1212
/// Do not follow any off-site redirects at any stage of
1313
/// the fetch or push.
1414
/// </summary>
15-
None = 0, // GIT_REMOTE_REDIRECT_NONE
15+
None = 1 << 0, // GIT_REMOTE_REDIRECT_NONE
1616

1717
/// <summary>
1818
/// Allow off-site redirects only upon the initial
1919
/// request. This is the default.
2020
/// </summary>
21-
Auto, // GIT_REMOTE_REDIRECT_INITIAL
21+
Initial = 1 << 1, // GIT_REMOTE_REDIRECT_INITIAL
2222

2323
/// <summary>
2424
/// Allow redirects at any stage in the fetch or push.
2525
/// </summary>
26-
All // GIT_REMOTE_REDIRECT_ALL
26+
All = 1 << 2 // GIT_REMOTE_REDIRECT_ALL
2727
}
2828
}

0 commit comments

Comments
 (0)