summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f01f109)
raw | patch | inline | side by side (parent: f01f109)
author | Felipe Contreras <felipe.contreras@gmail.com> | |
Wed, 13 May 2009 21:22:04 +0000 (00:22 +0300) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 14 May 2009 03:55:48 +0000 (20:55 -0700) |
In preparation to be used when the ref object is not available
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-fetch.c | patch | blob | history | |
builtin-send-pack.c | patch | blob | history | |
refs.c | patch | blob | history | |
refs.h | patch | blob | history | |
transport.c | patch | blob | history |
diff --git a/builtin-fetch.c b/builtin-fetch.c
index 3c998ea740adf474ee980fc763bd7156b9ce81af..ebd0c0878835c0664d59e62d0b269db313d5a422 100644 (file)
--- a/builtin-fetch.c
+++ b/builtin-fetch.c
struct commit *current = NULL, *updated;
enum object_type type;
struct branch *current_branch = branch_get(NULL);
- const char *pretty_ref = prettify_ref(ref);
+ const char *pretty_ref = prettify_refname(ref->name);
*display = 0;
type = sha1_object_info(ref->new_sha1, NULL);
diff --git a/builtin-send-pack.c b/builtin-send-pack.c
index d5a1c48d0e2abab16c646ce86ac9670b95dddc07..b2279b0d297a41692c7901f2113f0e220a0cd5e4 100644 (file)
--- a/builtin-send-pack.c
+++ b/builtin-send-pack.c
@@ -174,9 +174,9 @@ static void print_ref_status(char flag, const char *summary, struct ref *to, str
{
fprintf(stderr, " %c %-*s ", flag, SUMMARY_WIDTH, summary);
if (from)
- fprintf(stderr, "%s -> %s", prettify_ref(from), prettify_ref(to));
+ fprintf(stderr, "%s -> %s", prettify_refname(from->name), prettify_refname(to->name));
else
- fputs(prettify_ref(to), stderr);
+ fputs(prettify_refname(to->name), stderr);
if (msg) {
fputs(" (", stderr);
fputs(msg, stderr);
index e65a3b4c4ef57863a1055108d2598777cabc2c8d..e74461eaafb1b745be4f3fcda4ee8752ef580af9 100644 (file)
--- a/refs.c
+++ b/refs.c
}
}
-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 :
index 29d17a48e4a2923bc72337deb1ef64cf7b467381..c11f6a6d588d1bd737fa60241b9c67308f4c14cc 100644 (file)
--- a/refs.h
+++ b/refs.h
#define CHECK_REF_FORMAT_WILDCARD (-3)
extern int check_ref_format(const char *target);
-extern const char *prettify_ref(const struct ref *ref);
+extern const char *prettify_refname(const char *refname);
extern char *shorten_unambiguous_ref(const char *ref, int strict);
/** rename ref, return 0 on success **/
diff --git a/transport.c b/transport.c
index 3dfb03c06ed82102f60045d6889db97cf036651e..38c7f578e58c21d61f825ea6a47446f08b2a030e 100644 (file)
--- a/transport.c
+++ b/transport.c
@@ -732,9 +732,9 @@ static void print_ref_status(char flag, const char *summary, struct ref *to, str
{
fprintf(stderr, " %c %-*s ", flag, SUMMARY_WIDTH, summary);
if (from)
- fprintf(stderr, "%s -> %s", prettify_ref(from), prettify_ref(to));
+ fprintf(stderr, "%s -> %s", prettify_refname(from->name), prettify_refname(to->name));
else
- fputs(prettify_ref(to), stderr);
+ fputs(prettify_refname(to->name), stderr);
if (msg) {
fputs(" (", stderr);
fputs(msg, stderr);