Skip to content

Commit

Permalink
Aggregate git errors too
Browse files Browse the repository at this point in the history
  • Loading branch information
deivid-rodriguez committed Dec 7, 2022
1 parent 32846c4 commit f3818d2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion common/lib/dependabot/file_updaters/vendor_updater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ def updated_vendor_cache_files(base_directory:)
# rubocop:enable Performance/DeletePrefix

status = SharedHelpers.run_shell_command(
"git status --untracked-files all --porcelain v1 #{relative_dir}"
"git status --untracked-files all --porcelain v1 #{relative_dir}",
fingerprint: "git status --untracked-files all --porcelain v1 <relative_dir>"
)
changed_paths = status.split("\n").map(&:split)
changed_paths.map do |type, path|
Expand Down
3 changes: 2 additions & 1 deletion common/lib/dependabot/shared_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ def self.configure_git_to_use_https_with_credentials(credentials, safe_directori
run_shell_command(
"git config --global credential.helper " \
"'!#{credential_helper_path} --file #{Dir.pwd}/git.store'",
allow_unsafe_shell_command: true
allow_unsafe_shell_command: true,
fingerprint: "git config --global credential.helper '<helper_command>'"
)

# see https://github.blog/2022-04-12-git-security-vulnerability-announced/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@ def shortened_semver_eq?(base, other)

def find_container_branch(sha)
branches_including_ref = SharedHelpers.run_shell_command(
"git branch --remotes --contains #{sha}"
"git branch --remotes --contains #{sha}",
fingerprint: "git branch --remotes --contains <sha>"
).split("\n").map { |branch| branch.strip.gsub("origin/", "") }

current_branch = branches_including_ref.find { |branch| branch.start_with?("HEAD -> ") }
Expand Down

0 comments on commit f3818d2

Please sign in to comment.