diff options
author | Russell Belfer <rb@github.com> | 2013-01-14 10:05:35 -0800 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2013-01-14 10:05:35 -0800 |
commit | 848d77dc8314895d6ad1a9b36f30a36fc505e230 (patch) | |
tree | 9f2437618faaeb77121cdd7a54ac22bc8952d0ac /src | |
parent | 09e29e47b3ee18888cfb0fc4abd5346b390e70fb (diff) | |
parent | 72719e733318df8418641abb3c3d67d7a9ef42fc (diff) | |
download | libgit2-848d77dc8314895d6ad1a9b36f30a36fc505e230.tar.gz |
Merge pull request #1242 from sba1/init-with-template-fix
Some fixes for external template support
Diffstat (limited to 'src')
-rw-r--r-- | src/repository.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/repository.c b/src/repository.c index 46b7f8f48..014b40aff 100644 --- a/src/repository.c +++ b/src/repository.c @@ -1005,8 +1005,17 @@ static int repo_init_structure( tdir = GIT_TEMPLATE_DIR; } + /* FIXME: GIT_CPDIR_CHMOD cannot applied here as an attempt + * would be made to chmod() all directories up to the last + * component of repo_dir, e.g., also /home etc. Recall that + * repo_dir is prettified at this point. + * + * Best probably would be to have the same logic as in + * git_futils_mkdir(), i.e., to separate the base from + * the path. + */ error = git_futils_cp_r(tdir, repo_dir, - GIT_CPDIR_COPY_SYMLINKS | GIT_CPDIR_CHMOD, dmode); + GIT_CPDIR_COPY_SYMLINKS /*| GIT_CPDIR_CHMOD*/, dmode); if (error < 0) { if (strcmp(tdir, GIT_TEMPLATE_DIR) != 0) @@ -1015,6 +1024,7 @@ static int repo_init_structure( /* if template was default, ignore error and use internal */ giterr_clear(); external_tpl = false; + error = 0; } } |