Allow the test suite to pass in a directory whose name contains spaces
[gitweb.git] / read-cache.c
index f12da0dbb8b95fe234b07fcd536d794a1c6b5390..6238df448f8d7954b28630749336eceab70c67f3 100644 (file)
@@ -2428,6 +2428,14 @@ static int write_shared_index(struct index_state *istate,
                delete_tempfile(&temporary_sharedindex);
                return ret;
        }
+       ret = adjust_shared_perm(get_tempfile_path(&temporary_sharedindex));
+       if (ret) {
+               int save_errno = errno;
+               error("cannot fix permission bits on %s", get_tempfile_path(&temporary_sharedindex));
+               delete_tempfile(&temporary_sharedindex);
+               errno = save_errno;
+               return ret;
+       }
        ret = rename_tempfile(&temporary_sharedindex,
                              git_path("sharedindex.%s", sha1_to_hex(si->base->sha1)));
        if (!ret) {