diff options
author | Stefan Beller <sbeller@google.com> | 2018-05-18 00:51:51 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-05-18 01:13:10 +0200 |
commit | 102de880d24fe66a8916e7c984e5bf8db6be047c (patch) | |
tree | 0368ad2a280ca777b8edf01e77fb0ed1258c8c32 /blame.c | |
parent | cache: convert get_graft_file to handle arbitrary repositories (diff) | |
download | git-102de880d24fe66a8916e7c984e5bf8db6be047c.tar.xz git-102de880d24fe66a8916e7c984e5bf8db6be047c.zip |
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.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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); |