]> rtime.felk.cvut.cz Git - git.git/blobdiff - sha1_name.c
submodule: Fix documentation of update subcommand
[git.git] / sha1_name.c
index 5b004f513b999b31b7968b22dde955c859704853..cf2a83b14381ae02e737e6135561aab401f1f7e8 100644 (file)
@@ -372,10 +372,10 @@ const char *find_unique_abbrev(const unsigned char *sha1, int len)
        int status, exists;
        static char hex[41];
 
-       exists = has_sha1_file(sha1);
        memcpy(hex, sha1_to_hex(sha1), 40);
        if (len == 40 || !len)
                return hex;
+       exists = has_sha1_file(sha1);
        while (len < 40) {
                unsigned char sha1_ret[20];
                status = get_short_sha1(hex, len, sha1_ret, GET_SHA1_QUIETLY);
@@ -993,7 +993,7 @@ int get_sha1_mb(const char *name, unsigned char *sha1)
        two = lookup_commit_reference_gently(sha1_tmp, 0);
        if (!two)
                return -1;
-       mbs = get_merge_bases(one, two, 1);
+       mbs = get_merge_bases(one, two);
        if (!mbs || mbs->next)
                st = -1;
        else {