summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/branch.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/branch.c b/src/branch.c
index cd5c10ede..103dfe621 100644
--- a/src/branch.c
+++ b/src/branch.c
@@ -248,9 +248,11 @@ int git_branch_tracking(
goto cleanup;
refspec = git_remote_fetchspec(remote);
- if (refspec == NULL) {
- error = GIT_ENOTFOUND;
- goto cleanup;
+ if (refspec == NULL
+ || refspec->src == NULL
+ || refspec->dst == NULL) {
+ error = GIT_ENOTFOUND;
+ goto cleanup;
}
if (git_refspec_transform_r(&buf, refspec, merge_name) < 0)