summaryrefslogtreecommitdiff
path: root/src/repository.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-09-23 13:34:01 -0700
committerRussell Belfer <rb@github.com>2013-09-23 21:41:43 -0700
commit1ca3e49f889a3732922e6f2b303dfe0d9f74300a (patch)
tree29df13c2e8cd2e63eb03a46c695b350f729fd1bc /src/repository.c
parent10edb7a92a6d9b886f3dea083dba0aaba1851200 (diff)
downloadlibgit2-1ca3e49f889a3732922e6f2b303dfe0d9f74300a.tar.gz
Clean up newly introduced warnings
The attempt to "clean up warnings" seems to have introduced some new warnings on compliant compilers. This fixes those in a way that I suspect will also be okay for the non-compliant compilers. Also this fixes what appears to be an extra semicolon in the repo initialization template dir handling (and as part of that fix, handles the case where an error occurs correctly).
Diffstat (limited to 'src/repository.c')
-rw-r--r--src/repository.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/repository.c b/src/repository.c
index 6dea48790..0d7c09484 100644
--- a/src/repository.c
+++ b/src/repository.c
@@ -1145,17 +1145,19 @@ static int repo_init_structure(
}
if (!tdir) {
- if ((error = git_futils_find_template_dir(&template_buf)) >= 0);
+ if (!(error = git_futils_find_template_dir(&template_buf)))
tdir = template_buf.ptr;
default_template = true;
}
- error = git_futils_cp_r(tdir, repo_dir,
- GIT_CPDIR_COPY_SYMLINKS | GIT_CPDIR_CHMOD_DIRS |
- GIT_CPDIR_SIMPLE_TO_MODE, dmode);
+ if (tdir)
+ error = git_futils_cp_r(tdir, repo_dir,
+ GIT_CPDIR_COPY_SYMLINKS | GIT_CPDIR_CHMOD_DIRS |
+ GIT_CPDIR_SIMPLE_TO_MODE, dmode);
git_buf_free(&template_buf);
git_config_free(cfg);
+
if (error < 0) {
if (!default_template)
return error;