Skip to content

Bug - Failure of git log not managed #52

@pylapp

Description

@pylapp

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions