Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
strbuf_branchname: add docstring
author
Jeff King
<peff@peff.net>
Thu, 2 Mar 2017 08:21:30 +0000
(
03:21
-0500)
committer
Junio C Hamano
<gitster@pobox.com>
Thu, 2 Mar 2017 19:05:04 +0000
(11:05 -0800)
This function and its companion, strbuf_check_branch_ref(),
did not have their purpose or semantics explained. Let's do
so.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
strbuf.h
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
311fc74
)
diff --git
a/strbuf.h
b/strbuf.h
index 3bcde39183d75e3bba99a68f686e60e9bfc40176..2c40f1fdb2899fd9ac905e33852fc679ba552af0 100644
(file)
--- a/
strbuf.h
+++ b/
strbuf.h
@@
-562,7
+562,22
@@
static inline void strbuf_complete_line(struct strbuf *sb)
strbuf_complete(sb, '\n');
}
strbuf_complete(sb, '\n');
}
+/*
+ * Copy "name" to "sb", expanding any special @-marks as handled by
+ * interpret_branch_name(). The result is a non-qualified branch name
+ * (so "foo" or "origin/master" instead of "refs/heads/foo" or
+ * "refs/remotes/origin/master").
+ *
+ * Note that the resulting name may not be a syntactically valid refname.
+ */
extern void strbuf_branchname(struct strbuf *sb, const char *name);
extern void strbuf_branchname(struct strbuf *sb, const char *name);
+
+/*
+ * Like strbuf_branchname() above, but confirm that the result is
+ * syntactically valid to be used as a local branch name in refs/heads/.
+ *
+ * The return value is "0" if the result is valid, and "-1" otherwise.
+ */
extern int strbuf_check_branch_ref(struct strbuf *sb, const char *name);
extern void strbuf_addstr_urlencode(struct strbuf *, const char *,
extern int strbuf_check_branch_ref(struct strbuf *sb, const char *name);
extern void strbuf_addstr_urlencode(struct strbuf *, const char *,