From: Tomas Carnecky <tom@dbservice.com>
To: git@vger.kernel.org
Cc: Tomas Carnecky <tom@dbservice.com>
Subject: [PATCH 4/6] Rename get_mode() to decode_tree_mode() and export it
Date: Sun, 3 Oct 2010 14:21:49 +0200 [thread overview]
Message-ID: <1286108511-55876-4-git-send-email-tom@dbservice.com> (raw)
In-Reply-To: <4CA86A12.6080905@dbservice.com>
Other sources (fast-import-helper.c) may want to use this function
to parse trees.
Signed-off-by: Tomas Carnecky <tom@dbservice.com>
---
tree-walk.c | 4 ++--
tree-walk.h | 2 ++
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/tree-walk.c b/tree-walk.c
index a9bbf4e..5f51f4e 100644
--- a/tree-walk.c
+++ b/tree-walk.c
@@ -3,7 +3,7 @@
#include "unpack-trees.h"
#include "tree.h"
-static const char *get_mode(const char *str, unsigned int *modep)
+const char *decode_tree_mode(const char *str, unsigned int *modep)
{
unsigned char c;
unsigned int mode = 0;
@@ -28,7 +28,7 @@ static void decode_tree_entry(struct tree_desc *desc, const char *buf, unsigned
if (size < 24 || buf[size - 21])
die("corrupt tree file");
- path = get_mode(buf, &mode);
+ path = decode_tree_mode(buf, &mode);
if (!path || !*path)
die("corrupt tree file");
len = strlen(path) + 1;
diff --git a/tree-walk.h b/tree-walk.h
index 7e3e0b5..6bbde1c 100644
--- a/tree-walk.h
+++ b/tree-walk.h
@@ -13,6 +13,8 @@ struct tree_desc {
unsigned int size;
};
+const char *decode_tree_mode(const char *str, unsigned int *modep);
+
static inline const unsigned char *tree_entry_extract(struct tree_desc *desc, const char **pathp, unsigned int *modep)
{
*pathp = desc->entry.path;
--
1.7.3.37.gb6088b
next prev parent reply other threads:[~2010-10-03 12:22 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-03 11:33 [RFC] New type of remote helpers Tomas Carnecky
2010-10-03 12:21 ` [PATCH 1/6] Remote helper: accept ':<value> <name>' as a response to 'list' Tomas Carnecky
2010-10-05 2:00 ` Jonathan Nieder
2010-10-07 21:17 ` Sverre Rabbelier
2010-10-03 12:21 ` [PATCH 2/6] Allow more than one keepfile in the transport Tomas Carnecky
2010-10-05 2:11 ` Jonathan Nieder
2010-10-03 12:21 ` [PATCH 3/6] Allow the transport fetch command to add additional refs Tomas Carnecky
2010-10-05 2:18 ` Jonathan Nieder
2010-10-03 12:21 ` Tomas Carnecky [this message]
2010-10-05 2:23 ` [PATCH 4/6] Rename get_mode() to decode_tree_mode() and export it Jonathan Nieder
2010-10-03 12:21 ` [PATCH 5/6] Introduce the git fast-import-helper Tomas Carnecky
2010-10-03 15:31 ` Jonathan Nieder
2010-10-03 15:45 ` Tomas Carnecky
2010-10-03 15:53 ` Sverre Rabbelier
2010-10-03 17:39 ` Tomas Carnecky
2010-10-03 23:15 ` Sverre Rabbelier
2010-10-03 12:21 ` [PATCH 6/6] Add git-remote-svn Tomas Carnecky
2010-10-05 2:26 ` Jonathan Nieder
2010-10-03 13:56 ` [RFC] New type of remote helpers Sverre Rabbelier
2010-10-03 15:13 ` Jonathan Nieder
2010-10-03 17:07 ` Ramkumar Ramachandra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1286108511-55876-4-git-send-email-tom@dbservice.com \
--to=tom@dbservice.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).