#define NORETURN __attribute__((__noreturn__))
#else
#define NORETURN
+#ifndef __attribute__
+#define __attribute__(x)
+#endif
#endif
/*
*/
#define DEFAULT_GIT_PORT 9418
-/*
- * Environment variables transition.
- * We accept older names for now but warn.
- */
-extern char *gitenv_bc(const char *);
-#define gitenv(e) (getenv(e) ? : gitenv_bc(e))
-
/*
* Basic data structures for the directory cache
*/
#define ALTERNATE_DB_ENVIRONMENT "GIT_ALTERNATE_OBJECT_DIRECTORIES"
+extern const char **get_pathspec(const char *prefix, char **pathspec);
+extern const char *setup_git_directory(void);
+extern char *prefix_path(const char *prefix, int len, char *path);
+
#define alloc_nr(x) (((x)+16)*3/2)
/* Initialize and use the cache information */
#define TYPE_CHANGED 0x0040
/* Return a statically allocated filename matching the sha1 signature */
-extern char *mkpath(const char *fmt, ...);
-extern char *git_path(const char *fmt, ...);
+extern char *mkpath(const char *fmt, ...) __attribute__((format (printf, 1, 2)));
+extern char *git_path(const char *fmt, ...) __attribute__((format (printf, 1, 2)));
extern char *sha1_file_name(const unsigned char *sha1);
extern char *sha1_pack_name(const unsigned char *sha1);
extern char *sha1_pack_index_name(const unsigned char *sha1);
/* General helper functions */
extern void usage(const char *err) NORETURN;
-extern void die(const char *err, ...) NORETURN;
-extern int error(const char *err, ...);
+extern void die(const char *err, ...) NORETURN __attribute__((format (printf, 1, 2)));
+extern int error(const char *err, ...) __attribute__((format (printf, 1, 2)));
extern int base_name_compare(const char *name1, int len1, int mode1, const char *name2, int len2, int mode2);
extern int cache_name_compare(const char *name1, int len1, const char *name2, int len2);
extern int checkout_entry(struct cache_entry *ce, struct checkout *state);
extern struct alternate_object_database {
- char *base;
+ struct alternate_object_database *next;
char *name;
-} *alt_odb;
+ char base[0]; /* more */
+} *alt_odb_list;
extern void prepare_alt_odb(void);
extern struct packed_git {
struct ref *next;
unsigned char old_sha1[20];
unsigned char new_sha1[20];
+ unsigned char force;
struct ref *peer_ref; /* when renaming */
char name[0];
};
extern struct ref **get_remote_heads(int in, struct ref **list, int nr_match, char **match);
extern struct packed_git *parse_pack_index(unsigned char *sha1);
+extern struct packed_git *parse_pack_index_file(const unsigned char *sha1,
+ char *idx_path);
extern void prepare_packed_git(void);
extern void install_packed_git(struct packed_git *pack);