diff options
author | yuangli <yuangli@mathworks.com> | 2022-07-28 14:30:30 +0100 |
---|---|---|
committer | yuangli <yuangli@mathworks.com> | 2022-07-28 14:30:30 +0100 |
commit | 14d2a60a5bdb6fe62b65751bda0ce01a66ac5e99 (patch) | |
tree | 926c8e55679a83c1bb145821ba3e4268eb662056 | |
parent | c01b7841b77c08189eae916d21d591027962a831 (diff) | |
download | libgit2-14d2a60a5bdb6fe62b65751bda0ce01a66ac5e99.tar.gz |
fix load_grafts
-rw-r--r-- | src/libgit2/repository.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libgit2/repository.c b/src/libgit2/repository.c index c36666c43..809617276 100644 --- a/src/libgit2/repository.c +++ b/src/libgit2/repository.c @@ -735,6 +735,13 @@ static int load_grafts(git_repository *repo) git_str path = GIT_STR_INIT; int error; + if ((error = git_repository__item_path(&path, repo, GIT_REPOSITORY_ITEM_INFO)) < 0 || + (error = git_str_joinpath(&path, path.ptr, "grafts")) < 0 || + (error = git_grafts_from_file(&repo->grafts, path.ptr)) < 0) + goto error; + + git_str_clear(&path); + if ((error = git_str_joinpath(&path, repo->gitdir, "shallow")) < 0 || (error = git_grafts_from_file(&repo->shallow_grafts, path.ptr)) < 0) goto error; |