diff options
author | Vicent Martà <vicent@github.com> | 2013-03-05 15:35:28 -0800 |
---|---|---|
committer | Vicent Martà <vicent@github.com> | 2013-03-05 15:35:28 -0800 |
commit | b72f5d4038a21a27efcdec350376af0342ccf3f0 (patch) | |
tree | 73428317a150fa30e7b3efcaabcd73b503e50295 /src/fileops.h | |
parent | 3d74702eec07f2208211a72581c115340517ea4b (diff) | |
parent | 18f08264082dd436914c3c06d369e7a98ddf17aa (diff) | |
download | libgit2-b72f5d4038a21a27efcdec350376af0342ccf3f0.tar.gz |
Merge pull request #1369 from arrbee/repo-init-template-hooks
More tests (and fixes) for initializing repo from template
Diffstat (limited to 'src/fileops.h')
-rw-r--r-- | src/fileops.h | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/src/fileops.h b/src/fileops.h index f01f22706..7ba99d3d9 100644 --- a/src/fileops.h +++ b/src/fileops.h @@ -65,6 +65,7 @@ extern int git_futils_mkdir_r(const char *path, const char *base, const mode_t m * * GIT_MKDIR_CHMOD says to chmod the final directory entry after creation * * GIT_MKDIR_CHMOD_PATH says to chmod each directory component in the path * * GIT_MKDIR_SKIP_LAST says to leave off the last element of the path + * * GIT_MKDIR_SKIP_LAST2 says to leave off the last 2 elements of the path * * GIT_MKDIR_VERIFY_DIR says confirm final item is a dir, not just EEXIST * * Note that the chmod options will be executed even if the directory already @@ -76,7 +77,8 @@ typedef enum { GIT_MKDIR_CHMOD = 4, GIT_MKDIR_CHMOD_PATH = 8, GIT_MKDIR_SKIP_LAST = 16, - GIT_MKDIR_VERIFY_DIR = 32, + GIT_MKDIR_SKIP_LAST2 = 32, + GIT_MKDIR_VERIFY_DIR = 64, } git_futils_mkdir_flags; /** @@ -168,13 +170,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 = 1, - GIT_CPDIR_COPY_SYMLINKS = 2, - GIT_CPDIR_COPY_DOTFILES = 4, - GIT_CPDIR_OVERWRITE = 8, - GIT_CPDIR_CHMOD = 16 + 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_DIRS = (1u << 4), + GIT_CPDIR_SIMPLE_TO_MODE = (1u << 5), } git_futils_cpdir_flags; /** |