aboutsummaryrefslogtreecommitdiff
path: root/convert-objects.c
diff options
context:
space:
mode:
authorPeter Eriksen <s022018@student.dtu.dk>2006-04-02 14:44:09 +0200
committerJunio C Hamano <junkio@cox.net>2006-04-04 00:11:19 -0700
commit8e4402592574d630cdb5ab4f55a1b7131802ff72 (patch)
tree5891c240ca498628ae66b8a7069ad9b90f123a2b /convert-objects.c
parentfc9957b0052df6a8248420395bc9febd66194252 (diff)
downloadgit-8e4402592574d630cdb5ab4f55a1b7131802ff72.tar.gz
git-8e4402592574d630cdb5ab4f55a1b7131802ff72.tar.xz
Use blob_, commit_, tag_, and tree_type throughout.
This replaces occurences of "blob", "commit", "tag", and "tree", where they're really used as type specifiers, which we already have defined global constants for. Signed-off-by: Peter Eriksen <s022018@student.dtu.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'convert-objects.c')
-rw-r--r--convert-objects.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/convert-objects.c b/convert-objects.c
index b49bce268..57de37faa 100644
--- a/convert-objects.c
+++ b/convert-objects.c
@@ -2,6 +2,9 @@
#define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
#include <time.h>
#include "cache.h"
+#include "blob.h"
+#include "commit.h"
+#include "tree.h"
struct entry {
unsigned char old_sha1[20];
@@ -122,7 +125,7 @@ static int write_subdirectory(void *buffer, unsigned long size, const char *base
buffer += len;
}
- write_sha1_file(new, newlen, "tree", result_sha1);
+ write_sha1_file(new, newlen, tree_type, result_sha1);
free(new);
return used;
}
@@ -262,8 +265,8 @@ static void convert_date(void *buffer, unsigned long size, unsigned char *result
memcpy(new + newlen, buffer, size);
newlen += size;
- write_sha1_file(new, newlen, "commit", result_sha1);
- free(new);
+ write_sha1_file(new, newlen, commit_type, result_sha1);
+ free(new);
}
static void convert_commit(void *buffer, unsigned long size, unsigned char *result_sha1)
@@ -297,12 +300,12 @@ static struct entry * convert_entry(unsigned char *sha1)
buffer = xmalloc(size);
memcpy(buffer, data, size);
-
- if (!strcmp(type, "blob")) {
- write_sha1_file(buffer, size, "blob", entry->new_sha1);
- } else if (!strcmp(type, "tree"))
+
+ if (!strcmp(type, blob_type)) {
+ write_sha1_file(buffer, size, blob_type, entry->new_sha1);
+ } else if (!strcmp(type, tree_type))
convert_tree(buffer, size, entry->new_sha1);
- else if (!strcmp(type, "commit"))
+ else if (!strcmp(type, commit_type))
convert_commit(buffer, size, entry->new_sha1);
else
die("unknown object type '%s' in %s", type, sha1_to_hex(sha1));