Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify track creation #6991

Merged
merged 11 commits into from
Jul 23, 2024
Prev Previous commit
Next Next commit
Add safe directory when creating track
  • Loading branch information
ErikSchierboom committed Jul 12, 2024
commit 1c53868714c190aff16da41d5f17ec46f6bc6ea9
6 changes: 6 additions & 0 deletions app/commands/track/create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ class Track::Create
end

def call
add_safe_directory!

Track.create!(
slug: git_track.slug,
repo_url:,
Expand All @@ -24,4 +26,8 @@ def call

memoize
def git_track = Git::Track.new("HEAD", repo_url:)

def add_safe_directory!
system("git config --global --add safe.directory #{slug}")
end
end