I'd probably write this a little differently. Maybe something like:

```c
uint32_t cpflags = GIT_CPDIR_COPY_SYMLINKS | GIT_CPDIR_SIMPLE_TO_MODE;
if (opts->mode != GIT_REPOSITORY_INIT_SHARED_UMASK)
    cpflags |= GIT_CPDIR_CHMOD_DIRS;
error = git_futils_cp_r(tdir, repo_dir, cpflags, dmode);
```

That can all go into the `if (tdir) {` section, probably...