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

Commit 0d79c1b

Browse files
authored
Merge pull request #279 from github/fixes/assets-folder-included-intiailly
Fix to include Assets folder in initial commit
2 parents eca99ed + 61512e9 commit 0d79c1b

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
@@ -69,21 +69,19 @@ public void Run()
6969
{
7070
Logger.Trace("Adding files");
7171

72+
SetProjectToTextSerialization();
73+
7274
var gitignore = targetPath.Combine(".gitignore");
7375
var gitAttrs = targetPath.Combine(".gitattributes");
74-
var filesForInitialCommit = new List<string> { gitignore, gitAttrs };
76+
7577
AssemblyResources.ToFile(ResourceType.Generic, ".gitignore", targetPath);
7678
AssemblyResources.ToFile(ResourceType.Generic, ".gitattributes", targetPath);
7779

78-
SetProjectToTextSerialization();
80+
var assetsGitignore = targetPath.Combine("Assets", ".gitignore");
81+
assetsGitignore.CreateFile();
82+
83+
var filesForInitialCommit = new List<string> { gitignore, gitAttrs, assetsGitignore };
7984

80-
var assetsPath = targetPath.Combine("Assets");
81-
var hasFiles = assetsPath.Files(true).Any();
82-
if (!hasFiles)
83-
{
84-
var placeholder = assetsPath.CreateFile(".placeholder");
85-
filesForInitialCommit.Add(placeholder);
86-
}
8785
var addTask = new GitAddTask(environment, processManager, null, filesForInitialCommit);
8886
return addTask.RunAsync(token);
8987
}, token, TaskContinuationOptions.NotOnCanceled | TaskContinuationOptions.NotOnFaulted, ThreadingHelper.TaskScheduler)

0 commit comments

Comments
 (0)