mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-09 13:04:42 +00:00
Rev-parse: proper error checking.
This commit is contained in:
parent
7e79d389a4
commit
94952ded3a
@ -169,10 +169,9 @@ static int walk_ref_history(git_object **out, git_repository *repo, const char *
|
||||
giterr_set(GITERR_INVALID, "Invalid reflogspec %s", reflogspec);
|
||||
return GIT_ERROR;
|
||||
}
|
||||
git_reference_lookup(&ref, repo, "HEAD");
|
||||
git_reflog_read(&reflog, ref);
|
||||
git_reference_free(ref);
|
||||
|
||||
if (!git_reference_lookup(&ref, repo, "HEAD")) {
|
||||
if (!git_reflog_read(&reflog, ref)) {
|
||||
regex_error = regcomp(®ex, "checkout: moving from (.*) to .*", REG_EXTENDED);
|
||||
if (regex_error != 0) {
|
||||
giterr_set_regex(®ex, regex_error);
|
||||
@ -196,6 +195,9 @@ static int walk_ref_history(git_object **out, git_repository *repo, const char *
|
||||
}
|
||||
regfree(®ex);
|
||||
}
|
||||
}
|
||||
git_reference_free(ref);
|
||||
}
|
||||
} else {
|
||||
git_buf datebuf = GIT_BUF_INIT;
|
||||
git_buf_put(&datebuf, reflogspec+2, reflogspeclen-3);
|
||||
|
Loading…
Reference in New Issue
Block a user