Skip to content

Commit

Permalink
allow sync extension to continue even if git log empty
Browse files Browse the repository at this point in the history
  • Loading branch information
pzupan committed Apr 6, 2020
1 parent a146929 commit 08e5819
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions app/interactors/sync_extension_contents_at_versions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,16 @@ def set_compatible_platforms(version)
end

def set_last_commit(version)
commit = command_run.cmd("git log -1").gsub(/^Merge: [^\n]+\n/, "")
commit = command_run.cmd("git log -1")
# no git log for this release
return if commit.blank?

commit.gsub!(/^Merge: [^\n]+\n/, "")
sha, author, date = *commit.split("\n")

unless message = commit.split("\n\n").last
# Empty repo; no commits
return
end
message = commit.split("\n\n").last
# Empty repo; no commits
return if message.blank?

message = message.gsub("\n", " ").strip
sha = sha.gsub("commit ", "")
Expand Down

0 comments on commit 08e5819

Please sign in to comment.