Merge branch 'dp/cywginstat'
authorShawn O. Pearce <spearce@spearce.org>
Thu, 9 Oct 2008 17:24:14 +0000 (10:24 -0700)
committerShawn O. Pearce <spearce@spearce.org>
Thu, 9 Oct 2008 17:24:14 +0000 (10:24 -0700)
* dp/cywginstat:
cygwin: Use native Win32 API for stat
mingw: move common functionality to win32.h
add have_git_dir() function

1  2 
Makefile
cache.h
diff --combined Makefile
index dd31e339fb8d28baaaba78ea09518de0171d35a5,7db2ccc2962bea08c2dc944cdf8583733e670a12..308dc70b5de118083a14bcb2665372a40ae6522c
+++ 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 b5a5e03ac833468e952481858b23b332634f3b94,818804dad6e370f295209c482d3ecfcf953d7ad7..991544cf0bd7e84c5db5bd6486e5922a53ec136f
+++ b/cache.h
@@@ -6,14 -6,8 +6,14 @@@
  #include "hash.h"
  
  #include SHA1_HEADER
 -#include <zlib.h>
 +#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 <zlib.h>
  #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 *);