git-prompt.sh: if pc mode, immediately set PS1 to a plain prompt
[gitweb.git] / tree.c
diff --git a/tree.c b/tree.c
index bb02c1caa4ff6a8af40b89498de3af3381272999..58ebfce1bca609b0f7119eb210345c2065d02f40 100644 (file)
--- a/tree.c
+++ b/tree.c
@@ -30,9 +30,12 @@ static int read_one_entry_opt(const unsigned char *sha1, const char *base, int b
        return add_cache_entry(ce, opt);
 }
 
-static int read_one_entry(const unsigned char *sha1, const char *base, int baselen, const char *pathname, unsigned mode, int stage, void *context)
+static int read_one_entry(const unsigned char *sha1, struct strbuf *base,
+                         const char *pathname, unsigned mode, int stage,
+                         void *context)
 {
-       return read_one_entry_opt(sha1, base, baselen, pathname, mode, stage,
+       return read_one_entry_opt(sha1, base->buf, base->len, pathname,
+                                 mode, stage,
                                  ADD_CACHE_OK_TO_ADD|ADD_CACHE_SKIP_DFCHECK);
 }
 
@@ -40,9 +43,12 @@ static int read_one_entry(const unsigned char *sha1, const char *base, int basel
  * This is used when the caller knows there is no existing entries at
  * the stage that will conflict with the entry being added.
  */
-static int read_one_entry_quick(const unsigned char *sha1, const char *base, int baselen, const char *pathname, unsigned mode, int stage, void *context)
+static int read_one_entry_quick(const unsigned char *sha1, struct strbuf *base,
+                               const char *pathname, unsigned mode, int stage,
+                               void *context)
 {
-       return read_one_entry_opt(sha1, base, baselen, pathname, mode, stage,
+       return read_one_entry_opt(sha1, base->buf, base->len, pathname,
+                                 mode, stage,
                                  ADD_CACHE_JUST_APPEND);
 }
 
@@ -70,7 +76,7 @@ static int read_tree_1(struct tree *tree, struct strbuf *base,
                                continue;
                }
 
-               switch (fn(entry.sha1, base->buf, base->len,
+               switch (fn(entry.sha1, base,
                           entry.path, entry.mode, stage, context)) {
                case 0:
                        continue;