]> git.ipfire.org Git - thirdparty/git.git/blobdiff - sha1_file.c
completion: add some missing options to `git push`
[thirdparty/git.git] / sha1_file.c
index 34d527f6708fe242f75b7fa0fa98e36a5c96a3be..a38854ce553c1e59294d5542a37a5404ccd66dc5 100644 (file)
@@ -315,7 +315,8 @@ static int link_alt_odb_entry(const char *entry, const char *relative_base, int
         * thing twice, or object directory itself.
         */
        for (alt = alt_odb_list; alt; alt = alt->next) {
-               if (!memcmp(ent->base, alt->base, pfxlen)) {
+               if (pfxlen == alt->name - alt->base - 1 &&
+                   !memcmp(ent->base, alt->base, pfxlen)) {
                        free(ent);
                        return -1;
                }