Skip to content

check/sanitize committer/author e-Mail address #680

Closed
@moson-mo

Description

git is stripping some characters from the name/email address like <, >, \n
https://git-scm.com/docs/git-commit#_commit_information

With go-git if we do something like this (see Email field):

w.Commit("bad commit", &git.CommitOptions{
	Author: &object.Signature{
		Name:  "Wooops",
		Email: "<",
		When:  time.Now(),
	},
})

We'll end up with git fsck errors like:

error in commit 438bfa0c6212aea91d9d7af14e8e5fe405c0d6b4: badEmail: invalid author/committer line - bad email

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomershelp wantedExtra attention is neededno-autocloseIssues/PRs to be ignored by stale bot

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions