]> git.ipfire.org Git - thirdparty/git.git/blobdiff - sha1-file.c
Merge branch 'bc/sha-256-part-1-of-4'
[thirdparty/git.git] / sha1-file.c
index c36ca5a545542dc53f2bafa072b1cb689f0700f8..69268517242802283ce28a24fcbc49be2b8bdfd9 100644 (file)
@@ -694,20 +694,15 @@ void add_to_alternates_memory(const char *reference)
 char *compute_alternate_path(const char *path, struct strbuf *err)
 {
        char *ref_git = NULL;
-       const char *repo, *ref_git_s;
+       const char *repo;
        int seen_error = 0;
 
-       ref_git_s = real_path_if_valid(path);
-       if (!ref_git_s) {
+       ref_git = real_pathdup(path, 0);
+       if (!ref_git) {
                seen_error = 1;
                strbuf_addf(err, _("path '%s' does not exist"), path);
                goto out;
-       } else
-               /*
-                * Beware: read_gitfile(), real_path() and mkpath()
-                * return static buffer
-                */
-               ref_git = xstrdup(ref_git_s);
+       }
 
        repo = read_gitfile(ref_git);
        if (!repo)
@@ -1372,8 +1367,8 @@ static int loose_object_info(struct repository *r,
        struct strbuf hdrbuf = STRBUF_INIT;
        unsigned long size_scratch;
 
-       if (oi->delta_base_sha1)
-               hashclr(oi->delta_base_sha1);
+       if (oi->delta_base_oid)
+               oidclr(oi->delta_base_oid);
 
        /*
         * If we don't care about type or size, then we don't
@@ -1492,8 +1487,8 @@ static int do_oid_object_info_extended(struct repository *r,
                        *(oi->sizep) = co->size;
                if (oi->disk_sizep)
                        *(oi->disk_sizep) = 0;
-               if (oi->delta_base_sha1)
-                       hashclr(oi->delta_base_sha1);
+               if (oi->delta_base_oid)
+                       oidclr(oi->delta_base_oid);
                if (oi->type_name)
                        strbuf_addstr(oi->type_name, type_name(co->type));
                if (oi->contentp)