diff options
| author | Junio C Hamano <gitster@pobox.com> | 2020-03-25 13:57:42 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2020-03-25 13:57:43 -0700 |
| commit | 4d0e8996ec54e53149c2f24075eb64921ca61812 (patch) | |
| tree | 32333cbbf2a91ed8708ceda7e8ce998ccb369fc2 /builtin/commit-graph.c | |
| parent | Merge branch 'sg/commit-slab-clarify-peek' (diff) | |
| parent | get_superproject_working_tree(): return strbuf (diff) | |
| download | git-4d0e8996ec54e53149c2f24075eb64921ca61812.tar.gz git-4d0e8996ec54e53149c2f24075eb64921ca61812.zip | |
Merge branch 'am/real-path-fix'
The real_path() convenience function can easily be misused; with a
bit of code refactoring in the callers' side, its use has been
eliminated.
* am/real-path-fix:
get_superproject_working_tree(): return strbuf
real_path_if_valid(): remove unsafe API
real_path: remove unsafe API
set_git_dir: fix crash when used with real_path()
Diffstat (limited to 'builtin/commit-graph.c')
| -rw-r--r-- | builtin/commit-graph.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/builtin/commit-graph.c b/builtin/commit-graph.c index 4a70b33fb5..d1ab6625f6 100644 --- a/builtin/commit-graph.c +++ b/builtin/commit-graph.c @@ -39,14 +39,17 @@ static struct object_directory *find_odb(struct repository *r, { struct object_directory *odb; char *obj_dir_real = real_pathdup(obj_dir, 1); + struct strbuf odb_path_real = STRBUF_INIT; prepare_alt_odb(r); for (odb = r->objects->odb; odb; odb = odb->next) { - if (!strcmp(obj_dir_real, real_path(odb->path))) + strbuf_realpath(&odb_path_real, odb->path, 1); + if (!strcmp(obj_dir_real, odb_path_real.buf)) break; } free(obj_dir_real); + strbuf_release(&odb_path_real); if (!odb) die(_("could not find object directory matching %s"), obj_dir); |
