Skip search $PATH on command with fully qualified path (#526)

This commit is contained in:
Tingluo Huang
2020-06-11 13:52:42 -04:00
committed by GitHub
parent 312c7668a8
commit 2e800f857e
2 changed files with 24 additions and 0 deletions

View File

@@ -70,5 +70,24 @@ namespace GitHub.Runner.Common.Tests.Util
}
}
}
[Fact]
[Trait("Level", "L0")]
[Trait("Category", "Common")]
public void WhichHandleFullyQualifiedPath()
{
using (TestHostContext hc = new TestHostContext(this))
{
//Arrange
Tracing trace = hc.GetTrace();
// Act.
var gitPath = WhichUtil.Which("git", require: true, trace: trace);
var gitPath2 = WhichUtil.Which(gitPath, require: true, trace: trace);
// Assert.
Assert.Equal(gitPath, gitPath2);
}
}
}
}