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
diff options
context:
space:
mode:
authorDenton Liu <liu.denton@gmail.com>2020-04-07 17:27:54 +0300
committerJunio C Hamano <gitster@pobox.com>2020-04-08 02:57:30 +0300
commitc20de8bec6ba759c5e17ad8b8fd7105e8228e313 (patch)
tree440b9ac9c57f47879c8555fae812279309375625 /sequencer.c
parentbfa50c2c7f0cb806af6d272a84c16f114e15ceee (diff)
sequencer: make read_oneliner() extern
The function read_oneliner() is a generally useful util function. Instead of hiding it as a static function within sequencer.c, extern it so that it can be reused by others. This patch is best viewed with --color-moved. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sequencer.c')
-rw-r--r--sequencer.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/sequencer.c b/sequencer.c
index 32cc289da3..0d98ddc33c 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -419,19 +419,7 @@ static int write_message(const void *buf, size_t len, const char *filename,
return 0;
}
-#define READ_ONELINER_SKIP_IF_EMPTY (1 << 0)
-#define READ_ONELINER_WARN_MISSING (1 << 1)
-
-/*
- * Reads a file that was presumably written by a shell script, i.e. with an
- * end-of-line marker that needs to be stripped.
- *
- * Note that only the last end-of-line marker is stripped, consistent with the
- * behavior of "$(cat path)" in a shell script.
- *
- * Returns 1 if the file was read, 0 if it could not be read or does not exist.
- */
-static int read_oneliner(struct strbuf *buf,
+int read_oneliner(struct strbuf *buf,
const char *path, unsigned flags)
{
int orig_len = buf->len;