We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 5eb94f0 + 023bcb7 commit d878b99Copy full SHA for d878b99
ImgBot.Function/CompressImages.cs
@@ -36,9 +36,12 @@ public static async Task RunAsync(CompressimagesParameters parameters)
36
var repo = new LibGit2Sharp.Repository(parameters.LocalPath);
37
var remote = repo.Network.Remotes["origin"];
38
39
- // check if we have the branch already
+ // check if we have the branch already or this is empty repo
40
try
41
{
42
+ if (repo.Network.ListReferences(remote, credentialsProvider).Any() == false)
43
+ return;
44
+
45
if (repo.Network.ListReferences(remote, credentialsProvider).Any(x => x.CanonicalName == $"refs/heads/{BranchName}"))
46
return;
47
}
0 commit comments