summaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2007-12-10 01:22:42 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2007-12-10 01:22:42 -0800
commit7be2b6e02b4f2a1b4812764f65b12cafb11a934e (patch)
treec94ad7eb3a4d478a1c71eb6ef0aaf1c0f7348660 /refs.c
parentDocumentation: describe -w/--web option to "git-help". (diff)
parentUpdate draft Release Notes for 1.5.4 (diff)
downloadtgif-7be2b6e02b4f2a1b4812764f65b12cafb11a934e.tar.xz
Merge branch 'master' into cc/help
This is to primarily pull in MANPATH tweak and help.txt formatting fix from the master branch.
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/refs.c b/refs.c
index 54ec98d153..759924d0c9 100644
--- a/refs.c
+++ b/refs.c
@@ -643,6 +643,37 @@ int check_ref_format(const char *ref)
}
}
+const char *ref_rev_parse_rules[] = {
+ "%.*s",
+ "refs/%.*s",
+ "refs/tags/%.*s",
+ "refs/heads/%.*s",
+ "refs/remotes/%.*s",
+ "refs/remotes/%.*s/HEAD",
+ 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;
+ const int abbrev_name_len = strlen(abbrev_name);
+
+ for (p = rules; *p; p++) {
+ if (!strcmp(full_name, mkpath(*p, abbrev_name_len, abbrev_name))) {
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
static struct ref_lock *verify_lock(struct ref_lock *lock,
const unsigned char *old_sha1, int mustexist)
{
@@ -1063,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",