mirror of
https://github.com/super-linter/super-linter.git
synced 2024-12-22 12:42:09 -05:00
Issue hint when failing to switch back to branch (#4107)
* Issue hint when failing to switch back to branch Switching back to the branch fails with the below error on a shallow checkout: 2023-04-18 21:34:51 [ERROR] Failed to switch back to branch! 2023-04-18 21:34:51 [FATAL] [fatal: reference is not a tree: 3afa21b5f9bef8e81396e3572a598d089e710b96] With this change, it will look as follows: 2023-04-18 21:34:51 [ERROR] Failed to switch back to branch! 2023-04-18 21:34:51 [INFO] Check that you have the full git history, the checkout is not shallow, etc 2023-04-18 21:34:51 [INFO] See https://github.com/github/super-linter#example-connecting-github-action-workflow 2023-04-18 21:34:51 [FATAL] [fatal: reference is not a tree: 3afa21b5f9bef8e81396e3572a598d089e710b96] * Update lib/functions/buildFileList.sh --------- Co-authored-by: Philip Mallegol-Hansen <philip@mallegolhansen.com>
This commit is contained in:
parent
92f290dba4
commit
ef76367358
1 changed files with 10 additions and 2 deletions
|
@ -7,6 +7,14 @@
|
||||||
################################################################################
|
################################################################################
|
||||||
########################## FUNCTION CALLS BELOW ################################
|
########################## FUNCTION CALLS BELOW ################################
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
#### Function BuildFileList ####################################################
|
||||||
|
function IssueHintForFullGitHistory() {
|
||||||
|
info "Check that you have the full git history, the checkout is not shallow, etc"
|
||||||
|
info "See https://github.com/github/super-linter#example-connecting-github-action-workflow"
|
||||||
|
}
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
#### Function GenerateFileDiff #################################################
|
#### Function GenerateFileDiff #################################################
|
||||||
function GenerateFileDiff() {
|
function GenerateFileDiff() {
|
||||||
|
@ -33,8 +41,7 @@ function GenerateFileDiff() {
|
||||||
if [ ${ERROR_CODE} -ne 0 ]; then
|
if [ ${ERROR_CODE} -ne 0 ]; then
|
||||||
# Error
|
# Error
|
||||||
info "Failed to get Diff with:[$CMD]"
|
info "Failed to get Diff with:[$CMD]"
|
||||||
info "Check that you have the full git history, the checkout is not shallow, etc"
|
IssueHintForFullGitHistory
|
||||||
info "See https://github.com/github/super-linter#example-connecting-github-action-workflow"
|
|
||||||
fatal "[${CMD_OUTPUT}]"
|
fatal "[${CMD_OUTPUT}]"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -224,6 +231,7 @@ function BuildFileList() {
|
||||||
if [ ${ERROR_CODE} -ne 0 ]; then
|
if [ ${ERROR_CODE} -ne 0 ]; then
|
||||||
# Error
|
# Error
|
||||||
error "Failed to switch back to branch!"
|
error "Failed to switch back to branch!"
|
||||||
|
IssueHintForFullGitHistory
|
||||||
fatal "[${SWITCH2_CMD}]"
|
fatal "[${SWITCH2_CMD}]"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue