summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2019-05-12 22:06:00 +0100
committerEdward Thomson <ethomson@edwardthomson.com>2019-05-12 22:06:00 +0100
commitc9f116f148c9eb64988eb36ec83d1a653dc81ee0 (patch)
tree3d67e468faa306ad2c3e0cedfd15088abe485d5b /src
parent1e3a639d4af0e8acdf710b74ee7b230c39df84ae (diff)
parentab27c83561f5a312da7a6abe3221dfd7ee20d1fa (diff)
downloadlibgit2-c9f116f148c9eb64988eb36ec83d1a653dc81ee0.tar.gz
Merge branch 'pr/5061'
Diffstat (limited to 'src')
-rw-r--r--src/revwalk.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/revwalk.c b/src/revwalk.c
index 6d12d34eb..935bd4dde 100644
--- a/src/revwalk.c
+++ b/src/revwalk.c
@@ -194,10 +194,17 @@ int git_revwalk_push_range(git_revwalk *walk, const char *range)
if ((error = git_revparse(&revspec, walk->repo, range)))
return error;
+ if (!revspec.to) {
+ git_error_set(GIT_ERROR_INVALID, "invalid revspec: range not provided");
+ error = GIT_EINVALIDSPEC;
+ goto out;
+ }
+
if (revspec.flags & GIT_REVPARSE_MERGE_BASE) {
/* TODO: support "<commit>...<commit>" */
git_error_set(GIT_ERROR_INVALID, "symmetric differences not implemented in revwalk");
- return GIT_EINVALIDSPEC;
+ error = GIT_EINVALIDSPEC;
+ goto out;
}
if ((error = push_commit(walk, git_object_id(revspec.from), 1, false)))