Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 61512e9

Browse files
StanleyGoldmanshana
authored andcommitted
Adding a blank .gitignore file to the assets folder
1 parent 79ade7f commit 61512e9

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/GitHub.Api/RepositoryLocator.cs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,19 @@ public void Run()
5151
{
5252
Logger.Trace("Adding files");
5353

54+
SetProjectToTextSerialization();
55+
5456
var gitignore = targetPath.Combine(".gitignore");
5557
var gitAttrs = targetPath.Combine(".gitattributes");
56-
var filesForInitialCommit = new List<string> { gitignore, gitAttrs };
58+
5759
AssemblyResources.ToFile(ResourceType.Generic, ".gitignore", targetPath);
5860
AssemblyResources.ToFile(ResourceType.Generic, ".gitattributes", targetPath);
5961

60-
SetProjectToTextSerialization();
62+
var assetsGitignore = targetPath.Combine("Assets", ".gitignore");
63+
assetsGitignore.CreateFile();
64+
65+
var filesForInitialCommit = new List<string> { gitignore, gitAttrs, assetsGitignore };
6166

62-
var assetsPath = targetPath.Combine("Assets");
63-
var hasFiles = assetsPath.Files(true).Any();
64-
if (!hasFiles)
65-
{
66-
var placeholder = assetsPath.CreateFile(".placeholder");
67-
filesForInitialCommit.Add(placeholder);
68-
}
6967
var addTask = new GitAddTask(environment, processManager, null, filesForInitialCommit);
7068
return addTask.RunAsync(token);
7169
}, token, TaskContinuationOptions.NotOnCanceled | TaskContinuationOptions.NotOnFaulted, ThreadingHelper.TaskScheduler)

0 commit comments

Comments
 (0)