Commit 37cbc3ea by Carson Howard Committed by Carson Howard

examples: ls-files: build file list with array

parent d2f99e0a
......@@ -109,8 +109,8 @@ static int print_paths(ls_options *opts, git_index *index)
int main(int argc, char *argv[])
{
ls_options opts;
git_repository *repo;
git_index *index;
git_repository *repo = NULL;
git_index *index = NULL;
const git_index_entry *entry;
size_t entry_count;
size_t i = 0;
......@@ -121,10 +121,10 @@ int main(int argc, char *argv[])
git_libgit2_init();
if ((error = git_repository_open_ext(&repo, ".", 0, NULL)) != 0)
if ((error = git_repository_open_ext(&repo, ".", 0, NULL)) < 0)
goto cleanup;
if ((error = git_repository_index(&index, repo)) != 0)
if ((error = git_repository_index(&index, repo)) < 0)
goto cleanup;
/* if there are files explicitly listed by the user, we need to treat this command differently */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment