Skip to content

Commit

Permalink
Make noise
Browse files Browse the repository at this point in the history
  • Loading branch information
mfilipe committed Jul 24, 2024
1 parent 3121ad1 commit 6c2737c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/shipit/stack_commands.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def env
def fetch_commit(commit)
create_directories
if valid_git_repository?(@stack.git_path)
git('fetch', 'origin', '--quiet', '--tags', commit.sha, env: env, chdir: @stack.git_path)
git('fetch', 'origin', '--tags', commit.sha, env: env, chdir: @stack.git_path)
else
@stack.clear_git_cache!
git_clone(@stack.repo_git_url, @stack.git_path, branch: @stack.branch, env: env, chdir: @stack.deploys_path)
Expand All @@ -26,7 +26,7 @@ def fetch_commit(commit)
def fetch
create_directories
if valid_git_repository?(@stack.git_path)
git('fetch', 'origin', '--quiet', '--tags', @stack.branch, env: env, chdir: @stack.git_path)
git('fetch', 'origin', '--tags', @stack.branch, env: env, chdir: @stack.git_path)
else
@stack.clear_git_cache!
git_clone(@stack.repo_git_url, @stack.git_path, branch: @stack.branch, env: env, chdir: @stack.deploys_path)
Expand All @@ -35,7 +35,7 @@ def fetch

def fetched?(commit)
if valid_git_repository?(@stack.git_path)
git('rev-parse', '--quiet', '--verify', "#{commit.sha}^{commit}", env: env, chdir: @stack.git_path)
git('rev-parse', '--verify', "#{commit.sha}^{commit}", env: env, chdir: @stack.git_path)
else
# When the stack's git cache is not valid, the commit is
# NOT fetched. To keep the interface of this method
Expand Down Expand Up @@ -86,7 +86,6 @@ def with_temporary_working_directory(commit: nil)
'-c',
'advice.detachedHead=false',
'checkout',
'--quiet',
commit.sha,
chdir: git_dir
).run! if commit
Expand All @@ -107,7 +106,7 @@ def git_cmd_succeeds?(path)
end

def git_clone(url, path, branch: 'master', **kwargs)
git('clone', '--quiet', *modern_git_args, '--recursive', '--branch', branch, url, path, **kwargs)
git('clone', *modern_git_args, '--recursive', '--branch', branch, url, path, **kwargs)
end

def modern_git_args
Expand Down

0 comments on commit 6c2737c

Please sign in to comment.