Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/refs
diff options
context:
space:
mode:
Diffstat (limited to 'refs')
-rw-r--r--refs/debug.c12
-rw-r--r--refs/files-backend.c5
-rw-r--r--refs/packed-backend.c3
-rw-r--r--refs/refs-internal.h2
4 files changed, 11 insertions, 11 deletions
diff --git a/refs/debug.c b/refs/debug.c
index 8667c64023..791423c6a7 100644
--- a/refs/debug.c
+++ b/refs/debug.c
@@ -284,6 +284,7 @@ static int debug_print_reflog_ent(struct object_id *old_oid,
int ret;
char o[GIT_MAX_HEXSZ + 1] = "null";
char n[GIT_MAX_HEXSZ + 1] = "null";
+ char *msgend = strchrnul(msg, '\n');
if (old_oid)
oid_to_hex_r(o, old_oid);
if (new_oid)
@@ -291,8 +292,10 @@ static int debug_print_reflog_ent(struct object_id *old_oid,
ret = dbg->fn(old_oid, new_oid, committer, timestamp, tz, msg,
dbg->cb_data);
- trace_printf_key(&trace_refs, "reflog_ent %s (ret %d): %s -> %s, %s %ld \"%s\"\n",
- dbg->refname, ret, o, n, committer, (long int)timestamp, msg);
+ trace_printf_key(&trace_refs,
+ "reflog_ent %s (ret %d): %s -> %s, %s %ld \"%.*s\"\n",
+ dbg->refname, ret, o, n, committer,
+ (long int)timestamp, (int)(msgend - msg), msg);
return ret;
}
@@ -339,11 +342,10 @@ static int debug_reflog_exists(struct ref_store *ref_store, const char *refname)
}
static int debug_create_reflog(struct ref_store *ref_store, const char *refname,
- int force_create, struct strbuf *err)
+ struct strbuf *err)
{
struct debug_ref_store *drefs = (struct debug_ref_store *)ref_store;
- int res = drefs->refs->be->create_reflog(drefs->refs, refname,
- force_create, err);
+ int res = drefs->refs->be->create_reflog(drefs->refs, refname, err);
trace_printf_key(&trace_refs, "create_reflog: %s: %d\n", refname, res);
return res;
}
diff --git a/refs/files-backend.c b/refs/files-backend.c
index d0019fcd8b..90b671025a 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -1671,15 +1671,14 @@ error:
return -1;
}
-static int files_create_reflog(struct ref_store *ref_store,
- const char *refname, int force_create,
+static int files_create_reflog(struct ref_store *ref_store, const char *refname,
struct strbuf *err)
{
struct files_ref_store *refs =
files_downcast(ref_store, REF_STORE_WRITE, "create_reflog");
int fd;
- if (log_ref_setup(refs, refname, force_create, &fd, err))
+ if (log_ref_setup(refs, refname, 1, &fd, err))
return -1;
if (fd >= 0)
diff --git a/refs/packed-backend.c b/refs/packed-backend.c
index 9da932a540..67152c664e 100644
--- a/refs/packed-backend.c
+++ b/refs/packed-backend.c
@@ -1629,8 +1629,7 @@ static int packed_reflog_exists(struct ref_store *ref_store,
}
static int packed_create_reflog(struct ref_store *ref_store,
- const char *refname, int force_create,
- struct strbuf *err)
+ const char *refname, struct strbuf *err)
{
BUG("packed reference store does not support reflogs");
}
diff --git a/refs/refs-internal.h b/refs/refs-internal.h
index fb2c58ce3b..46a839539e 100644
--- a/refs/refs-internal.h
+++ b/refs/refs-internal.h
@@ -592,7 +592,7 @@ typedef int for_each_reflog_ent_reverse_fn(struct ref_store *ref_store,
void *cb_data);
typedef int reflog_exists_fn(struct ref_store *ref_store, const char *refname);
typedef int create_reflog_fn(struct ref_store *ref_store, const char *refname,
- int force_create, struct strbuf *err);
+ struct strbuf *err);
typedef int delete_reflog_fn(struct ref_store *ref_store, const char *refname);
typedef int reflog_expire_fn(struct ref_store *ref_store,
const char *refname,