Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
commit: allow lookup_commit_graft to handle arbitrary repositories
author
Stefan Beller
<sbeller@google.com>
Thu, 17 May 2018 22:51:54 +0000
(15:51 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Thu, 17 May 2018 23:13:10 +0000
(08:13 +0900)
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit.c
patch
|
blob
|
history
commit.h
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
2f6c767
)
diff --git
a/commit.c
b/commit.c
index eef1675d6926bded34c87c2573283aa54c75360d..b01cc0c3e0c420c9d188ec442dc15db4a43d316a 100644
(file)
--- a/
commit.c
+++ b/
commit.c
@@
-209,14
+209,14
@@
static void prepare_commit_graft(struct repository *r)
r->parsed_objects->commit_graft_prepared = 1;
}
r->parsed_objects->commit_graft_prepared = 1;
}
-struct commit_graft *lookup_commit_graft
_the_repository(
const struct object_id *oid)
+struct commit_graft *lookup_commit_graft
(struct repository *r,
const struct object_id *oid)
{
int pos;
{
int pos;
- prepare_commit_graft(
the_repository
);
- pos = commit_graft_pos(
the_repository
, oid->hash);
+ prepare_commit_graft(
r
);
+ pos = commit_graft_pos(
r
, oid->hash);
if (pos < 0)
return NULL;
if (pos < 0)
return NULL;
- return
the_repository
->parsed_objects->grafts[pos];
+ return
r
->parsed_objects->grafts[pos];
}
int for_each_commit_graft(each_commit_graft_fn fn, void *cb_data)
}
int for_each_commit_graft(each_commit_graft_fn fn, void *cb_data)
diff --git
a/commit.h
b/commit.h
index 45114a95b25af9571423712330de834dc0a445fb..6de6f10cd04357474cbb8eb84a60e85c60c792cf 100644
(file)
--- a/
commit.h
+++ b/
commit.h
@@
-175,8
+175,7
@@
typedef int (*each_commit_graft_fn)(const struct commit_graft *, void *);
struct commit_graft *read_graft_line(struct strbuf *line);
int register_commit_graft(struct repository *r, struct commit_graft *, int);
struct commit_graft *read_graft_line(struct strbuf *line);
int register_commit_graft(struct repository *r, struct commit_graft *, int);
-#define lookup_commit_graft(r, o) lookup_commit_graft_##r(o)
-struct commit_graft *lookup_commit_graft_the_repository(const struct object_id *oid);
+struct commit_graft *lookup_commit_graft(struct repository *r, const struct object_id *oid);
extern struct commit_list *get_merge_bases(struct commit *rev1, struct commit *rev2);
extern struct commit_list *get_merge_bases_many(struct commit *one, int n, struct commit **twos);
extern struct commit_list *get_merge_bases(struct commit *rev1, struct commit *rev2);
extern struct commit_list *get_merge_bases_many(struct commit *one, int n, struct commit **twos);