Skip to content

Will now throw LibGit2SharpException with proper message when 'user.name...#831

Merged
nulltoken merged 1 commit into
libgit2:vNextfrom
jaccus:vNext
Sep 18, 2014
Merged

Will now throw LibGit2SharpException with proper message when 'user.name...#831
nulltoken merged 1 commit into
libgit2:vNextfrom
jaccus:vNext

Conversation

@jaccus

@jaccus jaccus commented Sep 17, 2014

Copy link
Copy Markdown
Contributor

...' or 'user.email' global setting is set to an empty value

When global user.name or user.email is set to an empty value, it will
now throw a LibGit2SharpException with proper explanatory message.
Previously it would throw an ArgumentException with obscure message:
"String cannot be empty\nParameter name: name".

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've already made sure that neither the name or email are null or empty. Shouldn't we get rid of the null handling here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the null/empty value handling is within the if (shouldThrowIfNotFound) block. When that flag is turned off, the code you highlighted should still fall back to the defaults in case of null/empty values in settings.

@nulltoken

Copy link
Copy Markdown
Member

@jaccus Neat!

Could you please rebase onto vNext and reword your first line of the commit message so that it's a bit more terse (we usually prefer them to be 50 chars or less)?

Maybe something like Make BuildSignature() throw a descriptive message. Of course, please keep the second paragraph that provides the reader with a more in-depth understanding of what the commit is changing.

Once this is done, we'll happily merge this PR ✨ :

When global user.name or user.email is set to an empty value, it will
now throw a LibGit2SharpException with proper explanatory message.
Previously it would throw an ArgumentException with obscure message:
"String cannot be empty\nParameter name: name".
@jaccus

jaccus commented Sep 18, 2014

Copy link
Copy Markdown
Contributor Author

Amended the commit message and rebased.

@nulltoken nulltoken added this to the v0.20 milestone Sep 18, 2014
@nulltoken
nulltoken merged commit f3a6b7e into libgit2:vNext Sep 18, 2014
@nulltoken

Copy link
Copy Markdown
Member

Thanks! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants