Skip to content

Commit

Permalink
Fix proper display of git error messages in two-step actions such as …
Browse files Browse the repository at this point in the history
…branch drop merge
  • Loading branch information
phil294 committed Oct 1, 2024
1 parent 111e325 commit 303ae55
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,11 @@ module.exports.get_git = function(EXT_ID, logger, { on_repo_external_state_chang
last_git_execution = Date.now()
return stdout
} catch (error) {
let e = error
// stderr contains the full message, message itself is too short otherwise
e.message = e.stderr || e.stdout
throw e
// In the case of multi-step commands like branch drop merge, stdout instead
// contains the actual important message.
error.message = [error.stderr, error.stdout].join('\n')
throw error
}
},
set_selected_repo_index(/** @type {number} */ index) {
Expand Down

0 comments on commit 303ae55

Please sign in to comment.