Skip to content

Fix template dir empty string#4273

Merged
pks-t merged 3 commits intolibgit2:masterfrom
azdavis:fix-template-dir-empty-string
Jun 21, 2017
Merged

Fix template dir empty string#4273
pks-t merged 3 commits intolibgit2:masterfrom
azdavis:fix-template-dir-empty-string

Conversation

@azdavis
Copy link
Copy Markdown
Contributor

@azdavis azdavis commented Jun 17, 2017

Closes #4271.

This is my first time contributing to this project, so I hope I did everything correctly. I also added a test, which I verified does pass with the empty-string check I added, and fails otherwise.

Copy link
Copy Markdown
Member

@pks-t pks-t left a comment

Choose a reason for hiding this comment

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

Thanks for this PR, looks good besides some minor stylistic issues. Next to the comment, I'd propose you change your commit messages of 1c071c1 and 8cc25c7 to both include a "repository:" prefix. E.g.

repository: remove trailing whitespace
repository: do not initialize templates if dir is an empty string

Comment thread src/repository.c Outdated
}

if (tdir) {
/* if tdir was the empty string, treat it like tdir was a path to an
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 usually avoid asymmetric comments. Instead, we start multiline comments with a sole "/*". Furthermore, the fisrt character should be upper-cased. E.g.

/*
 * If tdir…
 * …
 */

See e.g. 1 as a reference (except for C99-style "//" comments).

@azdavis
Copy link
Copy Markdown
Contributor Author

azdavis commented Jun 19, 2017

Thanks for the comments. I've made some changes.

@pks-t pks-t merged commit 7785078 into libgit2:master Jun 21, 2017
@pks-t
Copy link
Copy Markdown
Member

pks-t commented Jun 21, 2017

Thanks for the fixes and your PR!

@ethomson
Copy link
Copy Markdown
Member

Welcome to libgit2! Thanks for tackling this and congrats on getting your first libgit2 PR merged! 🎉

success-kid-first-libgit2-pull-request-merged

@azdavis azdavis deleted the fix-template-dir-empty-string branch June 21, 2017 16:52
@pks-t pks-t added the backport label Jan 11, 2018
@pks-t pks-t mentioned this pull request Jan 12, 2018
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