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

Bug - Failure of git log not managed #52

Closed
pylapp opened this issue Mar 9, 2022 · 0 comments
Closed

Bug - Failure of git log not managed #52

pylapp opened this issue Mar 9, 2022 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@pylapp
Copy link
Member

pylapp commented Mar 9, 2022

Given I trigger the script extract-emails-from-history.sh on a repository without any commits
When the git log command is executed
The command and the scripts fail

The failure message is "fatal: your current branch 'master' does not have any commits yet" and the error code is 128

Solution: Check if there are commits and trap the failure signal:

if [ "$( git log --oneline -5 2>/dev/null | wc -l )" -eq 0 ]; then
    echo "Warning: Project '$git_based_project' is a git repository without any commit, that's weird"
    CleanFiles
    NormalExit
fi
@pylapp pylapp added bug Something isn't working doing Just to see if some work in being done on this issue labels Mar 9, 2022
@pylapp pylapp self-assigned this Mar 9, 2022
pylapp added a commit that referenced this issue Mar 9, 2022
@pylapp pylapp closed this as completed in 2d20ed6 Mar 9, 2022
@pylapp pylapp removed the doing Just to see if some work in being done on this issue label Mar 9, 2022
@pylapp pylapp added this to the 2.5.0 milestone Mar 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant