aboutsummaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-03-26 00:28:46 -0700
committerJunio C Hamano <gitster@pobox.com>2009-03-26 00:28:46 -0700
commitf23336f5c15eb90df3275076181d10746479be5b (patch)
treee1be7917fda3ee83120b58faf2a862a42275193d /refs.c
parent3fcee259d023087184c63eedf1015be6e23ea6e1 (diff)
parent64fcef2daa03f6093b480142c6ab2a4173b0b43e (diff)
downloadgit-f23336f5c15eb90df3275076181d10746479be5b.tar.gz
git-f23336f5c15eb90df3275076181d10746479be5b.tar.xz
Merge branch 'db/push-cleanup'
* db/push-cleanup: Move push matching and reporting logic into transport.c Use a common function to get the pretty name of refs Conflicts: transport.c
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/refs.c b/refs.c
index aeef257ee..26b001453 100644
--- a/refs.c
+++ b/refs.c
@@ -737,6 +737,16 @@ int check_ref_format(const char *ref)
}
}
+const char *prettify_ref(const struct ref *ref)
+{
+ const char *name = ref->name;
+ return name + (
+ !prefixcmp(name, "refs/heads/") ? 11 :
+ !prefixcmp(name, "refs/tags/") ? 10 :
+ !prefixcmp(name, "refs/remotes/") ? 13 :
+ 0);
+}
+
const char *ref_rev_parse_rules[] = {
"%.*s",
"refs/%.*s",