aboutsummaryrefslogtreecommitdiffstats
path: root/blame.c
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2018-05-17 15:51:51 -0700
committerJunio C Hamano <gitster@pobox.com>2018-05-18 08:13:10 +0900
commit102de880d24fe66a8916e7c984e5bf8db6be047c (patch)
tree0368ad2a280ca777b8edf01e77fb0ed1258c8c32 /blame.c
parent0437a2e365f3b9156097d029ca6f91cbb8bffd5e (diff)
downloadgit-102de880d24fe66a8916e7c984e5bf8db6be047c.tar.gz
path.c: migrate global git_path_* to take a repository argument
Migrate all git_path_* functions that are defined in path.c to take a repository argument. Unlike other patches in this series, do not use the #define trick, as we rewrite the whole function, which is rather small. This doesn't migrate all the functions, as other builtins have their own local path functions defined using GIT_PATH_FUNC. So keep that macro around to serve the other locations. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'blame.c')
-rw-r--r--blame.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/blame.c b/blame.c
index f689bde31c..c22184c2da 100644
--- a/blame.c
+++ b/blame.c
@@ -112,17 +112,19 @@ static void append_merge_parents(struct commit_list **tail)
int merge_head;
struct strbuf line = STRBUF_INIT;
- merge_head = open(git_path_merge_head(), O_RDONLY);
+ merge_head = open(git_path_merge_head(the_repository), O_RDONLY);
if (merge_head < 0) {
if (errno == ENOENT)
return;
- die("cannot open '%s' for reading", git_path_merge_head());
+ die("cannot open '%s' for reading",
+ git_path_merge_head(the_repository));
}
while (!strbuf_getwholeline_fd(&line, merge_head, '\n')) {
struct object_id oid;
if (line.len < GIT_SHA1_HEXSZ || get_oid_hex(line.buf, &oid))
- die("unknown line in '%s': %s", git_path_merge_head(), line.buf);
+ die("unknown line in '%s': %s",
+ git_path_merge_head(the_repository), line.buf);
tail = append_parent(tail, &oid);
}
close(merge_head);