diff options
| author | Etienne Samson <samson.etienne@gmail.com> | 2018-06-29 14:39:16 +0200 |
|---|---|---|
| committer | Etienne Samson <samson.etienne@gmail.com> | 2018-06-29 14:39:16 +0200 |
| commit | 292a6eca338932d33e9de77956919a781c9c4bd6 (patch) | |
| tree | a1c50b24c3fd7de7d3d09ef4ca8c13def7728988 /src/worktree.c | |
| parent | 8356bf7e1a7ef6fa68f1c918d03011bf774c9ffb (diff) | |
| download | libgit2-292a6eca338932d33e9de77956919a781c9c4bd6.tar.gz | |
worktree: skip building a buffer when validating
Diffstat (limited to 'src/worktree.c')
| -rw-r--r-- | src/worktree.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/worktree.c b/src/worktree.c index aa5c810ce..74e7a2fb9 100644 --- a/src/worktree.c +++ b/src/worktree.c @@ -234,13 +234,11 @@ void git_worktree_free(git_worktree *wt) int git_worktree_validate(const git_worktree *wt) { - git_buf buf = GIT_BUF_INIT; int err = 0; assert(wt); - git_buf_puts(&buf, wt->gitdir_path); - if (!is_worktree_dir(buf.ptr)) { + if (!is_worktree_dir(wt->gitdir_path)) { giterr_set(GITERR_WORKTREE, "Worktree gitdir ('%s') is not valid", wt->gitlink_path); @@ -265,7 +263,6 @@ int git_worktree_validate(const git_worktree *wt) } out: - git_buf_dispose(&buf); return err; } |
