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
Conversation
There was a problem hiding this 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 |
There was a problem hiding this comment.
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).
Thanks for the comments. I've made some changes. |
Thanks for the fixes and your PR! |
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.