summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: aba13e7)
raw | patch | inline | side by side (parent: aba13e7)
author | Alex Riesen <raa.lkml@gmail.com> | |
Mon, 27 Oct 2008 10:22:09 +0000 (11:22 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 31 Oct 2008 00:52:24 +0000 (17:52 -0700) |
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-config.c | patch | blob | history | |
builtin-reflog.c | patch | blob | history | |
builtin-revert.c | patch | blob | history | |
builtin-tag.c | patch | blob | history | |
config.c | patch | blob | history | |
environment.c | patch | blob | history | |
refs.c | patch | blob | history | |
rerere.c | patch | blob | history | |
server-info.c | patch | blob | history |
diff --git a/builtin-config.c b/builtin-config.c
index 91fdc4985d8e64fae12209174dd4aa2d887793e5..f71016204b540d0d935323c909a0ffccb1abdbe2 100644 (file)
--- a/builtin-config.c
+++ b/builtin-config.c
local = config_exclusive_filename;
if (!local) {
const char *home = getenv("HOME");
- local = repo_config = xstrdup(git_path("config"));
+ local = repo_config = git_pathdup("config");
if (git_config_global() && home)
global = xstrdup(mkpath("%s/.gitconfig", home));
if (git_config_system())
diff --git a/builtin-reflog.c b/builtin-reflog.c
index 196fa03b7fac795475a0e12f0fa3b443cb34bd1d..da96da317be01c24ae9711206976f48f33e39f97 100644 (file)
--- a/builtin-reflog.c
+++ b/builtin-reflog.c
@@ -277,11 +277,11 @@ static int expire_reflog(const char *ref, const unsigned char *sha1, int unused,
lock = lock_any_ref_for_update(ref, sha1, 0);
if (!lock)
return error("cannot lock ref '%s'", ref);
- log_file = xstrdup(git_path("logs/%s", ref));
+ log_file = git_pathdup("logs/%s", ref);
if (!file_exists(log_file))
goto finish;
if (!cmd->dry_run) {
- newlog_path = xstrdup(git_path("logs/%s.lock", ref));
+ newlog_path = git_pathdup("logs/%s.lock", ref);
cb.newlog = fopen(newlog_path, "w");
}
diff --git a/builtin-revert.c b/builtin-revert.c
index 27881e94937dd79b9a0524eb2d9770427ec4f4fb..5c4ab58f4643b8a1b77507c1cc0f0b8a70691ebf 100644 (file)
--- a/builtin-revert.c
+++ b/builtin-revert.c
int i;
char *oneline, *reencoded_message = NULL;
const char *message, *encoding;
- const char *defmsg = xstrdup(git_path("MERGE_MSG"));
+ const char *defmsg = git_pathdup("MERGE_MSG");
git_config(git_default_config, NULL);
me = action == REVERT ? "revert" : "cherry-pick";
diff --git a/builtin-tag.c b/builtin-tag.c
index f2853d08c77368b37b40c7ea51f5a124208d385f..6c6c35176e57a77fea85872fcea2c5b36f670e3e 100644 (file)
--- a/builtin-tag.c
+++ b/builtin-tag.c
int fd;
/* write the template message before editing: */
- path = xstrdup(git_path("TAG_EDITMSG"));
+ path = git_pathdup("TAG_EDITMSG");
fd = open(path, O_CREAT | O_TRUNC | O_WRONLY, 0600);
if (fd < 0)
die("could not create file '%s': %s",
diff --git a/config.c b/config.c
index 53f04a076a7275965090edd4ca2a34652c4f5679..82807c83b20ef8fbabfda7d476feff92f2dbb823 100644 (file)
--- a/config.c
+++ b/config.c
free(user_config);
}
- repo_config = xstrdup(git_path("config"));
+ repo_config = git_pathdup("config");
ret += git_config_from_file(fn, repo_config, data);
free(repo_config);
return ret;
if (config_exclusive_filename)
config_filename = xstrdup(config_exclusive_filename);
else
- config_filename = xstrdup(git_path("config"));
+ config_filename = git_pathdup("config");
/*
* Since "key" actually contains the section name and the real
if (config_exclusive_filename)
config_filename = xstrdup(config_exclusive_filename);
else
- config_filename = xstrdup(git_path("config"));
+ config_filename = git_pathdup("config");
out_fd = hold_lock_file_for_update(lock, config_filename, 0);
if (out_fd < 0) {
ret = error("could not lock config file %s", config_filename);
diff --git a/environment.c b/environment.c
index 0c6d11f6a0c6fa5dbab2f36c4b4ad4de5aba4ac9..df4f03a95f0b2098e97d0410bbb0589ff887e9cb 100644 (file)
--- a/environment.c
+++ b/environment.c
}
git_graft_file = getenv(GRAFT_ENVIRONMENT);
if (!git_graft_file)
- git_graft_file = xstrdup(git_path("info/grafts"));
+ git_graft_file = git_pathdup("info/grafts");
}
int is_bare_repository(void)
index 71443cdf85279933132266c8fdfc5d3dbcf043ca..d589b25562405b5361b6a6e49e2501361552c6ec 100644 (file)
--- a/refs.c
+++ b/refs.c
const char *lockpath;
char ref[1000];
int fd, len, written;
- char *git_HEAD = xstrdup(git_path("%s", ref_target));
+ char *git_HEAD = git_pathdup("%s", ref_target);
unsigned char old_sha1[20], new_sha1[20];
if (logmsg && read_ref(ref_target, old_sha1))
diff --git a/rerere.c b/rerere.c
index 323e493dafee46c0d3f95e3c4cd9c4c9b463bbef..3d6ee8fa2a647d6ee8459f700cbc450c94e7f179 100644 (file)
--- a/rerere.c
+++ b/rerere.c
if (!is_rerere_enabled())
return -1;
- merge_rr_path = xstrdup(git_path("MERGE_RR"));
+ merge_rr_path = git_pathdup("MERGE_RR");
fd = hold_lock_file_for_update(&write_lock, merge_rr_path, 1);
read_rr(merge_rr);
return fd;
diff --git a/server-info.c b/server-info.c
index c1c073b2f05a48772a45602cdc711eef6e211695..66b0d9d878a011393582b837301eb1fd5caf2e40 100644 (file)
--- a/server-info.c
+++ b/server-info.c
static int update_info_refs(int force)
{
- char *path0 = xstrdup(git_path("info/refs"));
+ char *path0 = git_pathdup("info/refs");
int len = strlen(path0);
char *path1 = xmalloc(len + 2);