-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from AshleighAdams/fetch-depth-bugfix
GitRepoInspector: Deepen(): Fetch from the point of the deepest commit.
- Loading branch information
Showing
6 changed files
with
144 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
tests/UnitTests/Mocks/MockCommandRunnerWithOldRemoteGitVersion.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
|
||
using Verlite; | ||
|
||
namespace UnitTests | ||
{ | ||
public sealed class MockCommandRunnerWithOldRemoteGitVersion : ICommandRunner | ||
{ | ||
private ICommandRunner BaseRunner { get; } | ||
public MockCommandRunnerWithOldRemoteGitVersion(ICommandRunner baseRunner) | ||
{ | ||
BaseRunner = baseRunner; | ||
} | ||
|
||
Task<(string stdout, string stderr)> ICommandRunner.Run( | ||
string directory, | ||
string command, | ||
string[] args, | ||
IDictionary<string, string>? envVars) | ||
{ | ||
string? firstArg = args.Length > 0 ? args[0] : null; | ||
|
||
return (command, firstArg, args) switch | ||
{ | ||
("git", "fetch", _) when args.Contains("origin") => | ||
throw new CommandException(128, "", "error: Server does not allow request for unadvertised object a1b2c3"), | ||
_ => BaseRunner.Run(directory, command, args, envVars), | ||
}; | ||
} | ||
} | ||
} |
File renamed without changes.