Code

git-filter-branch.sh: more portable tr usage: use \012, not \n.
[git.git] / refs.c
diff --git a/refs.c b/refs.c
index fc26a93cbadfe4795d06c99409f0b6e33aa22a20..759924d0c93621d72918f29145ae0377f34e8e0c 100644 (file)
--- a/refs.c
+++ b/refs.c
@@ -653,6 +653,13 @@ const char *ref_rev_parse_rules[] = {
        NULL
 };
 
+const char *ref_fetch_rules[] = {
+       "%.*s",
+       "refs/%.*s",
+       "refs/heads/%.*s",
+       NULL
+};
+
 int refname_match(const char *abbrev_name, const char *full_name, const char **rules)
 {
        const char **p;
@@ -1087,7 +1094,7 @@ static int log_ref_write(const char *ref_name, const unsigned char *old_sha1,
        adjust_shared_perm(log_file);
 
        msglen = msg ? strlen(msg) : 0;
-       committer = git_committer_info(-1);
+       committer = git_committer_info(0);
        maxlen = strlen(committer) + msglen + 100;
        logrec = xmalloc(maxlen);
        len = sprintf(logrec, "%s %s %s\n",
@@ -1457,3 +1464,11 @@ int update_ref(const char *action, const char *refname,
        }
        return 0;
 }
+
+struct ref *find_ref_by_name(struct ref *list, const char *name)
+{
+       for ( ; list; list = list->next)
+               if (!strcmp(list->name, name))
+                       return list;
+       return NULL;
+}