]> git.proxmox.com Git - libgit2.git/commitdiff
Do not use GIT_CPDIR_CHMOD flag when copying the template.
authorSebastian Bauer <mail@sebastianbauer.info>
Sun, 13 Jan 2013 10:30:05 +0000 (11:30 +0100)
committerSebastian Bauer <mail@sebastianbauer.info>
Sun, 13 Jan 2013 10:35:08 +0000 (11:35 +0100)
This is an intermin solution. While this essentially disables the
--shared flag feature, previously external templates did not work
at all. This change fixes the previously corrected, and since
then failing, repo_init__extended_with_template() test.

The problem is now documented in the source code comments.

src/repository.c

index 2c567c8925cf40215229e5d684aac50438acdfea..014b40aff4a7e017cf0e5bbc7dddaf821f580621 100644 (file)
@@ -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)