Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
sha1_name.c: get_sha1_1() takes lookup flags
author
Junio C Hamano
<gitster@pobox.com>
Mon, 2 Jul 2012 16:46:50 +0000
(09:46 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 9 Jul 2012 23:42:22 +0000
(16:42 -0700)
This is to pass the disambiguation hints from the caller down the
callchain. Nothing is changed in this step, as everybody just
passes 0 in the flag.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sha1_name.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
6269b6b
)
diff --git
a/sha1_name.c
b/sha1_name.c
index caef6e5e62ace50b0d285d6cb4e0fd5196ca7f51..8feb9b553ae1cd3f52126314d49a55724dc5773f 100644
(file)
--- a/
sha1_name.c
+++ b/
sha1_name.c
@@
-333,7
+333,7
@@
static inline int upstream_mark(const char *string, int len)
return 0;
}
return 0;
}
-static int get_sha1_1(const char *name, int len, unsigned char *sha1);
+static int get_sha1_1(const char *name, int len, unsigned char *sha1
, unsigned lookup_flags
);
static int get_sha1_basic(const char *str, int len, unsigned char *sha1)
{
static int get_sha1_basic(const char *str, int len, unsigned char *sha1)
{
@@
-370,7
+370,7
@@
static int get_sha1_basic(const char *str, int len, unsigned char *sha1)
ret = interpret_branch_name(str+at, &buf);
if (ret > 0) {
/* substitute this branch name and restart */
ret = interpret_branch_name(str+at, &buf);
if (ret > 0) {
/* substitute this branch name and restart */
- return get_sha1_1(buf.buf, buf.len, sha1);
+ return get_sha1_1(buf.buf, buf.len, sha1
, 0
);
} else if (ret == 0) {
return -1;
}
} else if (ret == 0) {
return -1;
}
@@
-440,7
+440,7
@@
static int get_parent(const char *name, int len,
unsigned char *result, int idx)
{
unsigned char sha1[20];
unsigned char *result, int idx)
{
unsigned char sha1[20];
- int ret = get_sha1_1(name, len, sha1);
+ int ret = get_sha1_1(name, len, sha1
, 0
);
struct commit *commit;
struct commit_list *p;
struct commit *commit;
struct commit_list *p;
@@
-473,7
+473,7
@@
static int get_nth_ancestor(const char *name, int len,
struct commit *commit;
int ret;
struct commit *commit;
int ret;
- ret = get_sha1_1(name, len, sha1);
+ ret = get_sha1_1(name, len, sha1
, 0
);
if (ret)
return ret;
commit = lookup_commit_reference(sha1);
if (ret)
return ret;
commit = lookup_commit_reference(sha1);
@@
-554,7
+554,7
@@
static int peel_onion(const char *name, int len, unsigned char *sha1)
else
return -1;
else
return -1;
- if (get_sha1_1(name, sp - name - 2, outer))
+ if (get_sha1_1(name, sp - name - 2, outer
, 0
))
return -1;
o = parse_object(outer);
return -1;
o = parse_object(outer);
@@
-621,7
+621,7
@@
static int get_describe_name(const char *name, int len, unsigned char *sha1)
return -1;
}
return -1;
}
-static int get_sha1_1(const char *name, int len, unsigned char *sha1)
+static int get_sha1_1(const char *name, int len, unsigned char *sha1
, unsigned lookup_flags
)
{
int ret, has_suffix;
const char *cp;
{
int ret, has_suffix;
const char *cp;
@@
-1098,7
+1098,7
@@
static int get_sha1_with_context_1(const char *name, unsigned char *sha1,
memset(oc, 0, sizeof(*oc));
oc->mode = S_IFINVALID;
memset(oc, 0, sizeof(*oc));
oc->mode = S_IFINVALID;
- ret = get_sha1_1(name, namelen, sha1);
+ ret = get_sha1_1(name, namelen, sha1
, 0
);
if (!ret)
return ret;
/* sha1:path --> object name of path in ent sha1
if (!ret)
return ret;
/* sha1:path --> object name of path in ent sha1
@@
-1176,7
+1176,7
@@
static int get_sha1_with_context_1(const char *name, unsigned char *sha1,
strncpy(object_name, name, cp-name);
object_name[cp-name] = '\0';
}
strncpy(object_name, name, cp-name);
object_name[cp-name] = '\0';
}
- if (!get_sha1_1(name, cp-name, tree_sha1)) {
+ if (!get_sha1_1(name, cp-name, tree_sha1
, 0
)) {
const char *filename = cp+1;
char *new_filename = NULL;
const char *filename = cp+1;
char *new_filename = NULL;