summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2012-08-24 10:48:48 -0700
committerRussell Belfer <rb@github.com>2012-08-24 10:48:48 -0700
commit2eb4edf5f269f60b188ff72d350ee321d1cbaf79 (patch)
tree8f0217382b94730cb7692653a313c526020bfe6f /src
parentc920e162325d0f9acba46a19c4619e6bfa17707e (diff)
downloadlibgit2-2eb4edf5f269f60b188ff72d350ee321d1cbaf79.tar.gz
Fix errors on Win32 with new repo init
Diffstat (limited to 'src')
-rw-r--r--src/fileops.c2
-rw-r--r--src/repository.c11
2 files changed, 8 insertions, 5 deletions
diff --git a/src/fileops.c b/src/fileops.c
index 5df312360..eecfc2847 100644
--- a/src/fileops.c
+++ b/src/fileops.c
@@ -604,7 +604,7 @@ static int _cp_r_callback(void *ref, git_buf *from)
return -1;
if (p_lstat(info->to.ptr, &to_st) < 0) {
- if (errno != ENOENT) {
+ if (errno != ENOENT && errno != ENOTDIR) {
giterr_set(GITERR_OS,
"Could not access %s while copying files", info->to.ptr);
return -1;
diff --git a/src/repository.c b/src/repository.c
index bf19d0706..18788d187 100644
--- a/src/repository.c
+++ b/src/repository.c
@@ -914,17 +914,20 @@ static int repo_init_structure(
mode_t dmode = pick_dir_mode(opts);
/* Hide the ".git" directory */
- if ((opts->flags & GIT_REPOSITORY_INIT_BARE) != 0) {
#ifdef GIT_WIN32
+ if ((opts->flags & GIT_REPOSITORY_INIT__HAS_DOTGIT) != 0) {
if (p_hide_directory__w32(repo_dir) < 0) {
giterr_set(GITERR_REPOSITORY,
"Failed to mark Git repository folder as hidden");
return -1;
}
-#endif
}
- /* Create .git gitlink if appropriate */
- else if ((opts->flags & GIT_REPOSITORY_INIT__NATURAL_WD) == 0) {
+#endif
+
+ /* Create the .git gitlink if appropriate */
+ if ((opts->flags & GIT_REPOSITORY_INIT_BARE) == 0 &&
+ (opts->flags & GIT_REPOSITORY_INIT__NATURAL_WD) == 0)
+ {
if (repo_write_gitlink(work_dir, repo_dir) < 0)
return -1;
}