From: Shawn O. Pearce Date: Thu, 9 Oct 2008 17:24:14 +0000 (-0700) Subject: Merge branch 'dp/cywginstat' X-Git-Tag: v1.6.1-rc1~161 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/ed187bd5936267744aa579ab1a33f0b07862a74b?hp=-c Merge branch 'dp/cywginstat' * dp/cywginstat: cygwin: Use native Win32 API for stat mingw: move common functionality to win32.h add have_git_dir() function --- ed187bd5936267744aa579ab1a33f0b07862a74b diff --combined Makefile index dd31e339fb,7db2ccc296..308dc70b5d --- a/Makefile +++ b/Makefile @@@ -346,6 -346,7 +346,7 @@@ LIB_H += cache. LIB_H += cache-tree.h LIB_H += commit.h LIB_H += compat/mingw.h + LIB_H += compat/cygwin.h LIB_H += csum-file.h LIB_H += decorate.h LIB_H += delta.h @@@ -648,8 -649,8 +649,8 @@@ ifeq ($(uname_S),SunOS NO_MEMMEM = YesPlease NO_HSTRERROR = YesPlease NO_MKDTEMP = YesPlease + OLD_ICONV = UnfortunatelyYes ifeq ($(uname_R),5.8) - NEEDS_LIBICONV = YesPlease NO_UNSETENV = YesPlease NO_SETENV = YesPlease NO_C99_FORMAT = YesPlease @@@ -748,6 -749,9 +749,9 @@@ ifeq ($(uname_S),HP-UX NO_SYS_SELECT_H = YesPlease SNPRINTF_RETURNS_BOGUS = YesPlease endif + ifneq (,$(findstring CYGWIN,$(uname_S))) + COMPAT_OBJS += compat/cygwin.o + endif ifneq (,$(findstring MINGW,$(uname_S))) NO_MMAP = YesPlease NO_PREAD = YesPlease diff --combined cache.h index b5a5e03ac8,818804dad6..991544cf0b --- a/cache.h +++ b/cache.h @@@ -6,14 -6,8 +6,14 @@@ #include "hash.h" #include SHA1_HEADER -#include +#ifndef git_SHA_CTX +#define git_SHA_CTX SHA_CTX +#define git_SHA1_Init SHA1_Init +#define git_SHA1_Update SHA1_Update +#define git_SHA1_Final SHA1_Final +#endif +#include #if defined(NO_DEFLATE_BOUND) || ZLIB_VERNUM < 0x1200 #define deflateBound(c,s) ((s) + (((s) + 7) >> 3) + (((s) + 63) >> 6) + 11) #endif @@@ -319,6 -313,7 +319,7 @@@ extern int is_bare_repository(void) extern int is_inside_git_dir(void); extern char *git_work_tree_cfg; extern int is_inside_work_tree(void); + extern int have_git_dir(void); extern const char *get_git_dir(void); extern char *get_object_directory(void); extern char *get_index_file(void); @@@ -377,7 -372,6 +378,7 @@@ extern int index_name_pos(const struct #define ADD_CACHE_OK_TO_REPLACE 2 /* Ok to replace file/directory */ #define ADD_CACHE_SKIP_DFCHECK 4 /* Ok to skip DF conflict checks */ #define ADD_CACHE_JUST_APPEND 8 /* Append only; tree.c::read_tree() */ +#define ADD_CACHE_NEW_ONLY 16 /* Do not replace existing ones */ extern int add_index_entry(struct index_state *, struct cache_entry *ce, int option); extern struct cache_entry *refresh_cache_entry(struct cache_entry *ce, int really); extern void rename_index_entry_at(struct index_state *, int pos, const char *new_name); @@@ -387,7 -381,6 +388,7 @@@ extern int remove_file_from_index(struc #define ADD_CACHE_PRETEND 2 #define ADD_CACHE_IGNORE_ERRORS 4 #define ADD_CACHE_IGNORE_REMOVAL 8 +#define ADD_CACHE_INTENT 16 extern int add_to_index(struct index_state *, const char *path, struct stat *, int flags); extern int add_file_to_index(struct index_state *, const char *path, int flags); extern struct cache_entry *make_cache_entry(unsigned int mode, const unsigned char *sha1, const char *path, int stage, int refresh); @@@ -757,6 -750,7 +758,6 @@@ typedef int (*config_fn_t)(const char * extern int git_default_config(const char *, const char *, void *); extern int git_config_from_file(config_fn_t fn, const char *, void *); extern int git_config(config_fn_t fn, void *); -extern int git_parse_long(const char *, long *); extern int git_parse_ulong(const char *, unsigned long *); extern int git_config_int(const char *, const char *); extern unsigned long git_config_ulong(const char *, const char *);