summaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/refs.c b/refs.c
index 3da3c8c..e49eaa3 100644
--- a/refs.c
+++ b/refs.c
@@ -683,12 +683,13 @@ int for_each_rawref(each_ref_fn fn, void *cb_data)
* - it has ASCII control character, "~", "^", ":" or SP, anywhere, or
* - it ends with a "/".
* - it ends with ".lock"
+ * - it contains a "\" (backslash)
*/
static inline int bad_ref_char(int ch)
{
if (((unsigned) ch) <= ' ' ||
- ch == '~' || ch == '^' || ch == ':')
+ ch == '~' || ch == '^' || ch == ':' || ch == '\\')
return 1;
/* 2.13 Pattern Matching Notation */
if (ch == '?' || ch == '[') /* Unsupported */
@@ -751,9 +752,8 @@ int check_ref_format(const char *ref)
}
}
-const char *prettify_ref(const struct ref *ref)
+const char *prettify_refname(const char *name)
{
- const char *name = ref->name;
return name + (
!prefixcmp(name, "refs/heads/") ? 11 :
!prefixcmp(name, "refs/tags/") ? 10 :
@@ -1419,7 +1419,7 @@ int read_ref_at(const char *ref, unsigned long at_time, int cnt, unsigned char *
logfile = git_path("logs/%s", ref);
logfd = open(logfile, O_RDONLY, 0);
if (logfd < 0)
- die("Unable to read log %s: %s", logfile, strerror(errno));
+ die_errno("Unable to read log '%s'", logfile);
fstat(logfd, &st);
if (!st.st_size)
die("Log %s is empty.", logfile);