summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e5709a4)
raw | patch | inline | side by side (parent: e5709a4)
author | Martin Koegler <mkoegler@auto.tuwien.ac.at> | |
Sun, 22 Apr 2007 16:43:59 +0000 (18:43 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 24 Apr 2007 07:08:49 +0000 (00:08 -0700) |
Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
revision.c | patch | blob | history | |
revision.h | patch | blob | history |
diff --git a/revision.c b/revision.c
index ce70f48ce0880e8b43c3f62cd13bc185bfee8c4b..49bd29225bd3be8b06cf4316e06761d5d3d6c011 100644 (file)
--- a/revision.c
+++ b/revision.c
}
void add_pending_object(struct rev_info *revs, struct object *obj, const char *name)
+{
+ add_pending_object_with_mode(revs, obj, name, S_IFINVALID);
+}
+
+void add_pending_object_with_mode(struct rev_info *revs, struct object *obj, const char *name, unsigned mode)
{
if (revs->no_walk && (obj->flags & UNINTERESTING))
die("object ranges do not make sense when not walking revisions");
- add_object_array(obj, name, &revs->pending);
+ add_object_array_with_mode(obj, name, &revs->pending, mode);
if (revs->reflog_info && obj->type == OBJ_COMMIT)
add_reflog_for_walk(revs->reflog_info,
(struct commit *)obj, name);
int flags,
int cant_be_filename)
{
+ unsigned mode;
char *dotdot;
struct object *object;
unsigned char sha1[20];
local_flags = UNINTERESTING;
arg++;
}
- if (get_sha1(arg, sha1))
+ if (get_sha1_with_mode(arg, sha1, &mode))
return -1;
if (!cant_be_filename)
verify_non_filename(revs->prefix, arg);
object = get_reference(revs, arg, sha1, flags ^ local_flags);
- add_pending_object(revs, object, arg);
+ add_pending_object_with_mode(revs, object, arg, mode);
return 0;
}
@@ -1177,10 +1183,11 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
if (def && !revs->pending.nr) {
unsigned char sha1[20];
struct object *object;
- if (get_sha1(def, sha1))
+ unsigned mode;
+ if (get_sha1_with_mode(def, sha1, &mode))
die("bad default revision '%s'", def);
object = get_reference(revs, def, sha1, 0);
- add_pending_object(revs, object, def);
+ add_pending_object_with_mode(revs, object, def, mode);
}
if (revs->topo_order)
diff --git a/revision.h b/revision.h
index 8a026184287479272ececf5cf3d5000c52007553..5b41e2da208c41ab316585b80a95e717fcbb198e 100644 (file)
--- a/revision.h
+++ b/revision.h
const char *name);
extern void add_pending_object(struct rev_info *revs, struct object *obj, const char *name);
+extern void add_pending_object_with_mode(struct rev_info *revs, struct object *obj, const char *name, unsigned mode);
#endif