Commit 1ca3e49f by Russell Belfer

Clean up newly introduced warnings

The attempt to "clean up warnings" seems to have introduced some
new warnings on compliant compilers.  This fixes those in a way
that I suspect will also be okay for the non-compliant compilers.

Also this fixes what appears to be an extra semicolon in the
repo initialization template dir handling (and as part of that
fix, handles the case where an error occurs correctly).
parent 10edb7a9
......@@ -120,9 +120,9 @@ typedef struct git_index_entry {
/** Capabilities of system that affect index actions. */
typedef enum {
GIT_INDEXCAP_IGNORE_CASE = 1,
GIT_INDEXCAP_NO_FILEMODE = 2,
GIT_INDEXCAP_NO_SYMLINKS = 4,
GIT_INDEXCAP_IGNORE_CASE = 1u,
GIT_INDEXCAP_NO_FILEMODE = 2u,
GIT_INDEXCAP_NO_SYMLINKS = 4u,
GIT_INDEXCAP_FROM_OWNER = ~0u
} git_indexcap_t;
......@@ -219,7 +219,7 @@ GIT_EXTERN(unsigned int) git_index_caps(const git_index *index);
* @param caps A combination of GIT_INDEXCAP values
* @return 0 on success, -1 on failure
*/
GIT_EXTERN(int) git_index_set_caps(git_index *index, int caps);
GIT_EXTERN(int) git_index_set_caps(git_index *index, unsigned int caps);
/**
* Update the contents of an existing index object in memory
......
......@@ -408,7 +408,7 @@ static int create_index_error(int error, const char *msg)
return error;
}
int git_index_set_caps(git_index *index, int caps)
int git_index_set_caps(git_index *index, unsigned int caps)
{
unsigned int old_ignore_case;
......
......@@ -1145,17 +1145,19 @@ static int repo_init_structure(
}
if (!tdir) {
if ((error = git_futils_find_template_dir(&template_buf)) >= 0);
if (!(error = git_futils_find_template_dir(&template_buf)))
tdir = template_buf.ptr;
default_template = true;
}
error = git_futils_cp_r(tdir, repo_dir,
GIT_CPDIR_COPY_SYMLINKS | GIT_CPDIR_CHMOD_DIRS |
GIT_CPDIR_SIMPLE_TO_MODE, dmode);
if (tdir)
error = git_futils_cp_r(tdir, repo_dir,
GIT_CPDIR_COPY_SYMLINKS | GIT_CPDIR_CHMOD_DIRS |
GIT_CPDIR_SIMPLE_TO_MODE, dmode);
git_buf_free(&template_buf);
git_config_free(cfg);
if (error < 0) {
if (!default_template)
return error;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment