diff options
author | Russell Belfer <rb@github.com> | 2013-02-28 01:44:15 +0400 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2013-02-28 01:44:15 +0400 |
commit | 18f08264082dd436914c3c06d369e7a98ddf17aa (patch) | |
tree | 3d254870ff7e85d9edaff5ffa80e733fdefffcb2 /src/fileops.h | |
parent | 0d1b094b07d836a657ad9e458e04490d1e72d365 (diff) |
Make mode handling during init more like git
When creating files, instead of actually using GIT_FILEMODE_BLOB
and the other various constants that happen to correspond to
mode values, apparently I should be just using 0666 and 0777, and
relying on the umask to clear bits and make the value sane.
This fixes the rules for copying a template directory and fixes
the checks to match that new behavior. (Further changes to the
checkout logic to follow separately.)
Diffstat (limited to 'src/fileops.h')
-rw-r--r-- | src/fileops.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/fileops.h b/src/fileops.h index 9e1f7440e..988cc661a 100644 --- a/src/fileops.h +++ b/src/fileops.h @@ -162,13 +162,26 @@ extern int git_futils_cp( /** * Flags that can be passed to `git_futils_cp_r`. + * + * - GIT_CPDIR_CREATE_EMPTY_DIRS: create directories even if there are no + * files under them (otherwise directories will only be created lazily + * when a file inside them is copied). + * - GIT_CPDIR_COPY_SYMLINKS: copy symlinks, otherwise they are ignored. + * - GIT_CPDIR_COPY_DOTFILES: copy files with leading '.', otherwise ignored. + * - GIT_CPDIR_OVERWRITE: overwrite pre-existing files with source content, + * otherwise they are silently skipped. + * - GIT_CPDIR_CHMOD_DIRS: explicitly chmod directories to `dirmode` + * - GIT_CPDIR_SIMPLE_TO_MODE: default tries to replicate the mode of the + * source file to the target; with this flag, always use 0666 (or 0777 if + * source has exec bits set) for target. */ typedef enum { GIT_CPDIR_CREATE_EMPTY_DIRS = (1u << 0), GIT_CPDIR_COPY_SYMLINKS = (1u << 1), GIT_CPDIR_COPY_DOTFILES = (1u << 2), GIT_CPDIR_OVERWRITE = (1u << 3), - GIT_CPDIR_CHMOD = (1u << 4), + GIT_CPDIR_CHMOD_DIRS = (1u << 4), + GIT_CPDIR_SIMPLE_TO_MODE = (1u << 5), } git_futils_cpdir_flags; /** |