aboutsummaryrefslogtreecommitdiff
path: root/ref-filter.c
diff options
context:
space:
mode:
authorKarthik Nayak <karthik.188@gmail.com>2017-01-10 14:19:46 +0530
committerJunio C Hamano <gitster@pobox.com>2017-01-10 12:44:31 -0800
commit17938f171f703c28696c7839a910565f0fb32121 (patch)
tree874b5647769e7109ce0277b2dd6314cfee5ba76a /ref-filter.c
parent3ba308cb4b4ad0d06fa834a42a9380c877b0c16a (diff)
downloadgit-17938f171f703c28696c7839a910565f0fb32121.tar.gz
git-17938f171f703c28696c7839a910565f0fb32121.tar.xz
ref-filter: rename the 'strip' option to 'lstrip'
In preparation for the upcoming patch, where we introduce the 'rstrip' option. Rename the 'strip' option to 'lstrip' to remove ambiguity. Signed-off-by: Karthik Nayak <Karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'ref-filter.c')
-rw-r--r--ref-filter.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/ref-filter.c b/ref-filter.c
index ffa29446c..cccd86f57 100644
--- a/ref-filter.c
+++ b/ref-filter.c
@@ -33,8 +33,8 @@ struct if_then_else {
};
struct refname_atom {
- enum { R_NORMAL, R_SHORT, R_STRIP } option;
- unsigned int strip;
+ enum { R_NORMAL, R_SHORT, R_LSTRIP } option;
+ unsigned int lstrip;
};
/*
@@ -91,10 +91,10 @@ static void refname_atom_parser_internal(struct refname_atom *atom,
atom->option = R_NORMAL;
else if (!strcmp(arg, "short"))
atom->option = R_SHORT;
- else if (skip_prefix(arg, "strip=", &arg)) {
- atom->option = R_STRIP;
- if (strtoul_ui(arg, 10, &atom->strip) || atom->strip <= 0)
- die(_("positive value expected refname:strip=%s"), arg);
+ else if (skip_prefix(arg, "lstrip=", &arg)) {
+ atom->option = R_LSTRIP;
+ if (strtoul_ui(arg, 10, &atom->lstrip) || atom->lstrip <= 0)
+ die(_("positive value expected refname:lstrip=%s"), arg);
} else
die(_("unrecognized %%(%s) argument: %s"), name, arg);
}
@@ -1091,7 +1091,7 @@ static inline char *copy_advance(char *dst, const char *src)
return dst;
}
-static const char *strip_ref_components(const char *refname, unsigned int len)
+static const char *lstrip_ref_components(const char *refname, unsigned int len)
{
long remaining = len;
const char *start = refname;
@@ -1099,7 +1099,7 @@ static const char *strip_ref_components(const char *refname, unsigned int len)
while (remaining) {
switch (*start++) {
case '\0':
- die(_("ref '%s' does not have %ud components to :strip"),
+ die(_("ref '%s' does not have %ud components to :lstrip"),
refname, len);
case '/':
remaining--;
@@ -1113,8 +1113,8 @@ static const char *show_ref(struct refname_atom *atom, const char *refname)
{
if (atom->option == R_SHORT)
return shorten_unambiguous_ref(refname, warn_ambiguous_refs);
- else if (atom->option == R_STRIP)
- return strip_ref_components(refname, atom->strip);
+ else if (atom->option == R_LSTRIP)
+ return lstrip_ref_components(refname, atom->lstrip);
else
return refname;
}