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)
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
*(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)