Thread (40 messages) flat view 40 messages, 5 authors, 2016-06-15
STALE3755d

Revision v2 of 2 in this series.

Revisions (2)
  1. v1 [diff vs current]
  2. v2 current

[PATCH v2 05/21] reflog: use avoid constructing .lock path with git_path

From: Nguyễn Thái Ngọc Duy <hidden>
Date: 2016-06-15 22:59:27
Subsystem: the rest · Maintainer: Linus Torvalds

git_path() understands the path given to it. Unrecognized paths by
default go to $GIT_SUPER_DIR/repos/<id>/... in split-repo mode. We
want the %s.lock file to be at the same place %s file is. Avoid
git_path() in this case and use log_file as %s, which should contain
the final path of %s file.

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
---
 builtin/reflog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/reflog.c b/builtin/reflog.c
index 6eb24c8..dc1accf 100644
--- a/builtin/reflog.c
+++ b/builtin/reflog.c
@@ -372,7 +372,7 @@ static int expire_reflog(const char *ref, const unsigned char *sha1, int unused,
 	if (!file_exists(log_file))
 		goto finish;
 	if (!cmd->dry_run) {
-		newlog_path = git_pathdup("logs/%s.lock", ref);
+		newlog_path = mkpathdup("%s.lock", log_file);
 		cb.newlog = fopen(newlog_path, "w");
 	}
 
-- 
1.8.5.1.77.g42c48fa
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help