upload-pack.c: do not pass confusing cb_data to mark_our_ref()
[gitweb.git] / builtin / apply.c
index 0e9b631db6db422b1e938d6168b608e0a2ae8618..50912c928f79cc0bcb4acf3ae50fd9fdc32193e8 100644 (file)
@@ -473,7 +473,7 @@ static char *find_name_gnu(const char *line, const char *def, int p_value)
 
        /*
         * Proposed "new-style" GNU patch/diff format; see
-        * http://marc.theaimsgroup.com/?l=git&m=112927316408690&w=2
+        * http://marc.info/?l=git&m=112927316408690&w=2
         */
        if (unquote_c_style(&name, line, NULL)) {
                strbuf_release(&name);
@@ -722,7 +722,7 @@ static char *find_name(const char *line, char *def, int p_value, int terminate)
 
 static char *find_name_traditional(const char *line, char *def, int p_value)
 {
-       size_t len = strlen(line);
+       size_t len;
        size_t date_len;
 
        if (*line == '"') {
@@ -2999,7 +2999,7 @@ static int read_blob_object(struct strbuf *buf, const unsigned char *sha1, unsig
        return 0;
 }
 
-static int read_file_or_gitlink(struct cache_entry *ce, struct strbuf *buf)
+static int read_file_or_gitlink(const struct cache_entry *ce, struct strbuf *buf)
 {
        if (!ce)
                return 0;
@@ -3117,7 +3117,7 @@ static struct patch *previous_patch(struct patch *patch, int *gone)
        return previous;
 }
 
-static int verify_index_match(struct cache_entry *ce, struct stat *st)
+static int verify_index_match(const struct cache_entry *ce, struct stat *st)
 {
        if (S_ISGITLINK(ce->ce_mode)) {
                if (!S_ISDIR(st->st_mode))
@@ -3130,7 +3130,7 @@ static int verify_index_match(struct cache_entry *ce, struct stat *st)
 #define SUBMODULE_PATCH_WITHOUT_INDEX 1
 
 static int load_patch_target(struct strbuf *buf,
-                            struct cache_entry *ce,
+                            const struct cache_entry *ce,
                             struct stat *st,
                             const char *name,
                             unsigned expected_mode)
@@ -3160,7 +3160,8 @@ static int load_patch_target(struct strbuf *buf,
  * we read from the result of a previous diff.
  */
 static int load_preimage(struct image *image,
-                        struct patch *patch, struct stat *st, struct cache_entry *ce)
+                        struct patch *patch, struct stat *st,
+                        const struct cache_entry *ce)
 {
        struct strbuf buf = STRBUF_INIT;
        size_t len;
@@ -3273,7 +3274,7 @@ static int load_current(struct image *image, struct patch *patch)
 }
 
 static int try_threeway(struct image *image, struct patch *patch,
-                       struct stat *st, struct cache_entry *ce)
+                       struct stat *st, const struct cache_entry *ce)
 {
        unsigned char pre_sha1[20], post_sha1[20], our_sha1[20];
        struct strbuf buf = STRBUF_INIT;
@@ -3343,7 +3344,7 @@ static int try_threeway(struct image *image, struct patch *patch,
        return 0;
 }
 
-static int apply_data(struct patch *patch, struct stat *st, struct cache_entry *ce)
+static int apply_data(struct patch *patch, struct stat *st, const struct cache_entry *ce)
 {
        struct image image;
 
@@ -3847,7 +3848,7 @@ static void add_index_file(const char *path, unsigned mode, void *buf, unsigned
                const char *s = buf;
 
                if (get_sha1_hex(s + strlen("Subproject commit "), ce->sha1))
-                       die(_("corrupt patch for subproject %s"), path);
+                       die(_("corrupt patch for submodule %s"), path);
        } else {
                if (!cached) {
                        if (lstat(path, &st) < 0)