313
struct append_ref_cb {
314
struct ref_list *ref_list;
315
const char **pattern;
316
- int ret;
316
};
317
318
static int match_patterns(const char **pattern, const char *refname)
369
commit = NULL;
370
if (ref_list->verbose || ref_list->with_commit || merge_filter != NO_FILTER) {
371
commit = lookup_commit_reference_gently(oid->hash, 1);
373
- if (!commit) {
374
- cb->ret = error(_("branch '%s' does not point at a commit"), refname);
372
+ if (!commit)
373
return 0;
376
- }
374
375
/* Filter with with_commit if specified */
376
if (!is_descendant_of(commit, ref_list->with_commit))
614
return max;
615
}
616
620
-static int print_ref_list(int kinds, int detached, int verbose, int abbrev, struct commit_list *with_commit, const char **pattern)
617
+static void print_ref_list(int kinds, int detached, int verbose, int abbrev, struct commit_list *with_commit, const char **pattern)
618
{
619
int i;
620
struct append_ref_cb cb;
639
init_revisions(&ref_list.revs, NULL);
640
cb.ref_list = &ref_list;
641
cb.pattern = pattern;
645
- cb.ret = 0;
642
/*
643
* First we obtain all regular branch refs and if the HEAD is
644
* detached then we insert that ref to the end of the ref_fist
689
abbrev, detached, remote_prefix);
690
691
free_ref_list(&ref_list);
696
-
697
- if (cb.ret)
698
- error(_("some refs could not be read"));
699
-
700
- return cb.ret;
692
}
693
694
static void rename_branch(const char *oldname, const char *newname, int force)
904
die(_("branch name required"));
905
return delete_branches(argc, argv, delete > 1, kinds, quiet);
906
} else if (list) {
916
- int ret;
907
/* git branch --local also shows HEAD when it is detached */
908
if (kinds & REF_LOCAL_BRANCH)
909
kinds |= REF_DETACHED_HEAD;
920
- ret = print_ref_list(kinds, detached, verbose, abbrev,
910
+ print_ref_list(kinds, detached, verbose, abbrev,
911
with_commit, argv);
912
print_columns(&output, colopts, NULL);
913
string_list_clear(&output, 0);
924
- return ret;
914
+ return 0;
915
}
916
else if (edit_description) {
917
const char *branch_name;