Merge branch 'dl/complete-submodule-absorbgitdirs'
[gitweb.git] / builtin / fetch.c
index 61a443031d9ace9f2019e1c02ff265e7da0ec960..b620fd54b4e95cad77532ec3fe02e2ff1179c431 100644 (file)
@@ -317,8 +317,7 @@ static void find_non_local_tags(const struct ref *refs,
                            !has_object_file_with_flags(&ref->old_oid,
                                                        OBJECT_INFO_QUICK) &&
                            !will_fetch(head, ref->old_oid.hash) &&
-                           !has_sha1_file_with_flags(item->oid.hash,
-                                                     OBJECT_INFO_QUICK) &&
+                           !has_object_file_with_flags(&item->oid, OBJECT_INFO_QUICK) &&
                            !will_fetch(head, item->oid.hash))
                                oidclr(&item->oid);
                        item = NULL;
@@ -332,7 +331,7 @@ static void find_non_local_tags(const struct ref *refs,
                 * fetch.
                 */
                if (item &&
-                   !has_sha1_file_with_flags(item->oid.hash, OBJECT_INFO_QUICK) &&
+                   !has_object_file_with_flags(&item->oid, OBJECT_INFO_QUICK) &&
                    !will_fetch(head, item->oid.hash))
                        oidclr(&item->oid);
 
@@ -353,7 +352,7 @@ static void find_non_local_tags(const struct ref *refs,
         * checked to see if it needs fetching.
         */
        if (item &&
-           !has_sha1_file_with_flags(item->oid.hash, OBJECT_INFO_QUICK) &&
+           !has_object_file_with_flags(&item->oid, OBJECT_INFO_QUICK) &&
            !will_fetch(head, item->oid.hash))
                oidclr(&item->oid);
 
@@ -629,9 +628,14 @@ static int find_and_replace(struct strbuf *haystack,
                            const char *needle,
                            const char *placeholder)
 {
-       const char *p = strstr(haystack->buf, needle);
+       const char *p = NULL;
        int plen, nlen;
 
+       nlen = strlen(needle);
+       if (ends_with(haystack->buf, needle))
+               p = haystack->buf + haystack->len - nlen;
+       else
+               p = strstr(haystack->buf, needle);
        if (!p)
                return 0;
 
@@ -639,7 +643,6 @@ static int find_and_replace(struct strbuf *haystack,
                return 0;
 
        plen = strlen(p);
-       nlen = strlen(needle);
        if (plen > nlen && p[nlen] != '/')
                return 0;
 
@@ -1477,7 +1480,7 @@ static inline void fetch_one_setup_partial(struct remote *remote)
        if (strcmp(remote->name, repository_format_partial_clone)) {
                if (filter_options.choice)
                        die(_("--filter can only be used with the remote "
-                             "configured in extensions.partialclone"));
+                             "configured in extensions.partialClone"));
                return;
        }