8000 Teach UpdateLibgit2ToSha.ps1 to take arbitrary libgit2 library name. · freevoid/libgit2sharp@384ce73 · GitHub
[go: up one dir, main page]

Skip to content

Commit 384ce73

Browse files
jamillnulltoken
authored andcommitted
Teach UpdateLibgit2ToSha.ps1 to take arbitrary libgit2 library name.
1 parent a496c1c commit 384ce73

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

UpdateLibgit2ToSha.ps1

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
Desired libgit2 version. This is run through `git rev-parse`, so branch names are okay too.
66
.PARAMETER vs
77
Version of Visual Studio project files to generate. Cmake supports "10" (default) and "11".
8+
.PARAMETER libgit2Name
9+
The base name (i.e without the file extension) of the libgit2 DLL to generate. Default is to use git2-$suffix, where $suffix is the first 7 characters of the SHA1 of the corresponding libgi2 commit as the suffix.
810
.PARAMETER test
911
If set, run the libgit2 tests on the desired version.
1012
.PARAMETER debug
@@ -14,6 +16,7 @@
1416
Param(
1517
[string]$sha = 'HEAD',
1618
[string]$vs = '10',
19+
[string]$libgit2Name = '',
1720
[switch]$test,
1821
[switch]$debug
1922
)
@@ -127,8 +130,12 @@ function Assert-Consistent-Naming($expected, $path) {
127130
popd
128131
break
129132
}
130-
$shortsha = $sha.Substring(0,7)
131-
$binaryFilename = "git2-$shortsha"
133+
134+
if(![string]::IsNullOrEmpty($libgit2Name)) {
135+
$binaryFilename = $libgit2Name
136+
} else {
137+
$binaryFilename = "git2-" + $sha.Substring(0,7)
138+
}
132139

133140
Write-Output "Checking out $sha..."
134141
Run-Command -Quiet -Fatal { & $git checkout $sha }
@@ -166,7 +173,7 @@ namespace LibGit2Sharp.Core
166173
{
167174
internal static class NativeDllName
168175
{
169-
public const string Name = "git2-$shortsha";
176+
public const string Name = "$binaryFilename.dll";
170177
}
171178
}
172179
"@

0 commit comments

Comments
 (0)
0