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

Fix template dir empty string #4273

Merged
merged 3 commits into from Jun 21, 2017
Merged

Fix template dir empty string #4273

merged 3 commits into from Jun 21, 2017

Conversation

azdavis
Copy link
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
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

src/repository.c Outdated
@@ -1784,7 +1784,12 @@ static int repo_init_structure(
default_template = true;
}

if (tdir) {
/* if tdir was the empty string, treat it like tdir was a path to an
Copy link
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
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
Member

pks-t commented Jun 21, 2017

Thanks for the fixes and your PR!

@ethomson
Copy link
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.

None yet

3 participants