summaryrefslogtreecommitdiff
path: root/builtin/pull.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/pull.c')
-rw-r--r--builtin/pull.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/builtin/pull.c b/builtin/pull.c
index 388ef3d130..a1ebc6ad33 100644
--- a/builtin/pull.c
+++ b/builtin/pull.c
@@ -7,6 +7,7 @@
*/
#define USE_THE_REPOSITORY_VARIABLE
+
#include "builtin.h"
#include "advice.h"
#include "config.h"
@@ -218,8 +219,8 @@ static struct option pull_options[] = {
OPT_PASSTHRU_ARGV(0, "shallow-since", &opt_fetch, N_("time"),
N_("deepen history of shallow repository based on time"),
0),
- OPT_PASSTHRU_ARGV(0, "shallow-exclude", &opt_fetch, N_("revision"),
- N_("deepen history of shallow clone, excluding rev"),
+ OPT_PASSTHRU_ARGV(0, "shallow-exclude", &opt_fetch, N_("ref"),
+ N_("deepen history of shallow clone, excluding ref"),
0),
OPT_PASSTHRU_ARGV(0, "deepen", &opt_fetch, N_("n"),
N_("deepen history of shallow clone"),
@@ -737,7 +738,8 @@ static const char *get_tracking_branch(const char *remote, const char *refspec)
const char *spec_src;
const char *merge_branch;
- refspec_item_init_or_die(&spec, refspec, REFSPEC_FETCH);
+ if (!refspec_item_init_fetch(&spec, refspec))
+ die(_("invalid refspec '%s'"), refspec);
spec_src = spec.src;
if (!*spec_src || !strcmp(spec_src, "HEAD"))
spec_src = "HEAD";
@@ -941,11 +943,10 @@ static int get_can_ff(struct object_id *orig_head,
static int already_up_to_date(struct object_id *orig_head,
struct oid_array *merge_heads)
{
- int i;
struct commit *ours;
ours = lookup_commit_reference(the_repository, orig_head);
- for (i = 0; i < merge_heads->nr; i++) {
+ for (size_t i = 0; i < merge_heads->nr; i++) {
struct commit_list *list = NULL;
struct commit *theirs;
int ok;