Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
files-backend: move "logs/" out of TMP_RENAMED_LOG
author
Nguyễn Thái Ngọc Duy
<pclouds@gmail.com>
Sun, 26 Mar 2017 02:42:21 +0000
(09:42 +0700)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 27 Mar 2017 17:23:39 +0000
(10:23 -0700)
This makes reflog path building consistent, always in the form of
strbuf_git_path(sb, "logs/%s", refname);
It reduces the mental workload a bit in the next patch when that
function call is converted.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs/files-backend.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
e9dcc30
)
diff --git
a/refs/files-backend.c
b/refs/files-backend.c
index 5f9b0ab9bc65adb141433645342a912d8c531f5b..3e0bafcaf93cf76582a52d3113b02e6f442c1a56 100644
(file)
--- a/
refs/files-backend.c
+++ b/
refs/files-backend.c
@@
-2510,7
+2510,7
@@
static int files_delete_refs(struct ref_store *ref_store,
* IOW, to avoid cross device rename errors, the temporary renamed log must
* live into logs/refs.
*/
* IOW, to avoid cross device rename errors, the temporary renamed log must
* live into logs/refs.
*/
-#define TMP_RENAMED_LOG "
logs/
refs/.tmp-renamed-log"
+#define TMP_RENAMED_LOG "refs/.tmp-renamed-log"
struct rename_cb {
const char *tmp_renamed_log;
struct rename_cb {
const char *tmp_renamed_log;
@@
-2546,7
+2546,7
@@
static int rename_tmp_log(const char *newrefname)
int ret;
strbuf_git_path(&path, "logs/%s", newrefname);
int ret;
strbuf_git_path(&path, "logs/%s", newrefname);
- strbuf_git_path(&tmp, TMP_RENAMED_LOG);
+ strbuf_git_path(&tmp,
"logs/%s",
TMP_RENAMED_LOG);
cb.tmp_renamed_log = tmp.buf;
ret = raceproof_create_file(path.buf, rename_tmp_log_callback, &cb);
if (ret) {
cb.tmp_renamed_log = tmp.buf;
ret = raceproof_create_file(path.buf, rename_tmp_log_callback, &cb);
if (ret) {
@@
-2608,7
+2608,7
@@
static int files_rename_ref(struct ref_store *ref_store,
strbuf_git_path(&sb_oldref, "logs/%s", oldrefname);
strbuf_git_path(&sb_newref, "logs/%s", newrefname);
strbuf_git_path(&sb_oldref, "logs/%s", oldrefname);
strbuf_git_path(&sb_newref, "logs/%s", newrefname);
- strbuf_git_path(&tmp_renamed_log, TMP_RENAMED_LOG);
+ strbuf_git_path(&tmp_renamed_log,
"logs/%s",
TMP_RENAMED_LOG);
log = !lstat(sb_oldref.buf, &loginfo);
if (log && S_ISLNK(loginfo.st_mode)) {
log = !lstat(sb_oldref.buf, &loginfo);
if (log && S_ISLNK(loginfo.st_mode)) {
@@
-2633,7
+2633,7
@@
static int files_rename_ref(struct ref_store *ref_store,
}
if (log && rename(sb_oldref.buf, tmp_renamed_log.buf)) {
}
if (log && rename(sb_oldref.buf, tmp_renamed_log.buf)) {
- ret = error("unable to move logfile logs/%s to "TMP_RENAMED_LOG": %s",
+ ret = error("unable to move logfile logs/%s to
logs/
"TMP_RENAMED_LOG": %s",
oldrefname, strerror(errno));
goto out;
}
oldrefname, strerror(errno));
goto out;
}
@@
-2719,7
+2719,7
@@
static int files_rename_ref(struct ref_store *ref_store,
oldrefname, newrefname, strerror(errno));
if (!logmoved && log &&
rename(tmp_renamed_log.buf, sb_oldref.buf))
oldrefname, newrefname, strerror(errno));
if (!logmoved && log &&
rename(tmp_renamed_log.buf, sb_oldref.buf))
- error("unable to restore logfile %s from "TMP_RENAMED_LOG": %s",
+ error("unable to restore logfile %s from
logs/
"TMP_RENAMED_LOG": %s",
oldrefname, strerror(errno));
ret = 1;
out:
oldrefname, strerror(errno));
ret = 1;
out: