Browse Source

Merge branch 'sg/skip-prefix-in-prettify-refname'

Code cleanup.

* sg/skip-prefix-in-prettify-refname:
  refs.c: use skip_prefix() in prettify_refname()
maint
Junio C Hamano 8 years ago
parent
commit
f494890292
  1. 10
      refs.c

10
refs.c

@ -366,11 +366,11 @@ int for_each_glob_ref(each_ref_fn fn, const char *pattern, void *cb_data) @@ -366,11 +366,11 @@ int for_each_glob_ref(each_ref_fn fn, const char *pattern, void *cb_data)

const char *prettify_refname(const char *name)
{
return name + (
starts_with(name, "refs/heads/") ? 11 :
starts_with(name, "refs/tags/") ? 10 :
starts_with(name, "refs/remotes/") ? 13 :
0);
if (skip_prefix(name, "refs/heads/", &name) ||
skip_prefix(name, "refs/tags/", &name) ||
skip_prefix(name, "refs/remotes/", &name))
; /* nothing */
return name;
}

static const char *ref_rev_parse_rules[] = {

Loading…
Cancel
Save