Skip to content

Commit 9861468

Browse files
authored
GH Syncer Tweaks (exercism#7901)
1 parent abc09f0 commit 9861468

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

app/commands/user/github_solution_syncer/files_for_iteration.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class FilesForIteration
66

77
def call
88
files.map do |filename, content|
9-
next unless content.present?
9+
next unless content.to_s.scrub("").present?
1010

1111
{
1212
path: "#{path}/#{filename}",

app/commands/user/github_solution_syncer/local_git_repo.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,15 @@ def base_branch_name
5151
def repo = syncer.repo_full_name
5252

5353
def clone_repo
54-
git("clone", "--depth=1", "--branch=#{base_branch_name}", repo_url, ".")
54+
git("clone", "--depth=1", repo_url, ".")
55+
56+
begin
57+
git("checkout", base_branch_name)
58+
rescue RuntimeError
59+
git "checkout", "-b", base_branch_name
60+
git "commit", "--allow-empty", "-m", "Initial empty commit"
61+
git "push", "origin", base_branch_name
62+
end
5563
end
5664

5765
def create_branch

0 commit comments

Comments
 (0)