summaryrefslogtreecommitdiff
path: root/builtin-reflog.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-10-30 18:08:58 -0700
committerJunio C Hamano <gitster@pobox.com>2008-10-30 18:08:58 -0700
commit98b35e2c749614446b916230148d66857e8a09f3 (patch)
tree3cf15ee4e22a7ebf84e92b019a26ef424d540857 /builtin-reflog.c
parent058412d09748c90be996a70729b961adad084175 (diff)
parenta4f34cbb4cea1f0b0e625b528f269f4b517c64f8 (diff)
downloadgit-98b35e2c749614446b916230148d66857e8a09f3.tar.gz
Merge branch 'ar/maint-mksnpath' into ar/mksnpath
* ar/maint-mksnpath: Use git_pathdup instead of xstrdup(git_path(...)) git_pathdup: returns xstrdup-ed copy of the formatted path Fix potentially dangerous use of git_path in ref.c Add git_snpath: a .git path formatting routine with output buffer Conflicts: builtin-revert.c refs.c rerere.c
Diffstat (limited to 'builtin-reflog.c')
-rw-r--r--builtin-reflog.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin-reflog.c b/builtin-reflog.c
index 6b3667ef0e..d95f515f2e 100644
--- 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");
}