X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=refs.c;h=fb258ea9928ee22ca22ff9a4862993dace92dff9;hb=7b51c33b376d22195dba1c4e067180164fd35dbf;hp=e5b2b1ac2bf535e931165ff1cb4691163c1843a2;hpb=48f36dcd7320d27a840e89fc2aa7ab11716951c6;p=git.git diff --git a/refs.c b/refs.c index e5b2b1ac2..fb258ea99 100644 --- a/refs.c +++ b/refs.c @@ -862,7 +862,7 @@ int for_each_rawref(each_ref_fn fn, void *cb_data) static inline int bad_ref_char(int ch) { - if (((unsigned) ch) <= ' ' || + if (((unsigned) ch) <= ' ' || ch == 0x7f || ch == '~' || ch == '^' || ch == ':' || ch == '\\') return 1; /* 2.13 Pattern Matching Notation */ @@ -1211,7 +1211,6 @@ int delete_ref(const char *refname, const unsigned char *sha1, int delopt) int rename_ref(const char *oldref, const char *newref, const char *logmsg) { - static const char renamed_ref[] = "RENAMED-REF"; unsigned char sha1[20], orig_sha1[20]; int flag = 0, logmoved = 0; struct ref_lock *lock; @@ -1235,13 +1234,6 @@ int rename_ref(const char *oldref, const char *newref, const char *logmsg) if (!is_refname_available(newref, oldref, get_loose_refs(NULL), 0)) return 1; - lock = lock_ref_sha1_basic(renamed_ref, NULL, 0, NULL); - if (!lock) - return error("unable to lock %s", renamed_ref); - lock->force_write = 1; - if (write_ref_sha1(lock, orig_sha1, logmsg)) - return error("unable to save current sha1 in %s", renamed_ref); - if (log && rename(git_path("logs/%s", oldref), git_path(TMP_RENAMED_LOG))) return error("unable to move logfile logs/%s to "TMP_RENAMED_LOG": %s", oldref, strerror(errno));