git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 3/5] convert: Use the enum constant SAFE_CRLF_FALSE.

From
Henrik Grubbström (Grubba) <grubba@grubba.org>
Date
Mar 29, 2010, 11:28 UTC
Message-ID
<74ce7980eb1fe629a651433ca9f1662f26495ce9.1269860022.git.grubba@grubba.org>
In-Reply-To
<6d9d8b0eaa022f441c507b141ff0efa3f21d1988.1269860022.git.grubba@grubba.org>

A few places used plain zeros as the last argument to convert_to_git, instead of the corresponding enum constant.

Signed-off-by: Henrik Grubbström <grubba@grubba.org>
---
Suggested by Bert Wesarg <bert.wesarg@googlemail.com>.
 builtin/apply.c |    2 +-
 builtin/blame.c |    2 +-
 sha1_file.c     |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/builtin/apply.c b/builtin/apply.c
index 7ca9047..6dbe1d7 100644
--- a/builtin/apply.c
+++ b/builtin/apply.c
@@ -1759,7 +1759,7 @@ static int read_old_data(struct stat *st, const char *path, struct strbuf *buf)
 	case S_IFREG:
 		if (strbuf_read_file(buf, path, st->st_size) != st->st_size)
 			return error("unable to open or read %s", path);
-		convert_to_git(path, buf->buf, buf->len, buf, 0);
+		convert_to_git(path, buf->buf, buf->len, buf, SAFE_CRLF_FALSE);
 		return 0;
 	default:
 		return -1;
diff --git a/builtin/blame.c b/builtin/blame.c
index fc15863..3af045b 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -2050,7 +2050,7 @@ static struct commit *fake_working_tree_commit(const char *path, const char *con
 		if (strbuf_read(&buf, 0, 0) < 0)
 			die_errno("failed to read from stdin");
 	}
-	convert_to_git(path, buf.buf, buf.len, &buf, 0);
+	convert_to_git(path, buf.buf, buf.len, &buf, SAFE_CRLF_FALSE);
 	origin->file.ptr = buf.buf;
 	origin->file.size = buf.len;
 	pretend_sha1_file(buf.buf, buf.len, OBJ_BLOB, origin->blob_sha1);
diff --git a/sha1_file.c b/sha1_file.c
index a08a9d0..96c69cc 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -2417,7 +2417,7 @@ static int index_mem(unsigned char *sha1, void *buf, size_t size,
 	if ((type == OBJ_BLOB) && path) {
 		struct strbuf nbuf = STRBUF_INIT;
 		if (convert_to_git(path, buf, size, &nbuf,
-		                   write_object ? safe_crlf : 0)) {
+		                   write_object ? safe_crlf : SAFE_CRLF_FALSE)) {
 			buf = strbuf_detach(&nbuf, &size);
 			re_allocated = 1;
 		}
-- 
1.6.4.122.g6ffd7
Previous: Henrik Grubbström (Grubba)Next: Henrik Grubbström (Grubba)
Message 4 of 14 in “ident attribute related patches (resend w/ testsuite v3)”
  1. 0/5 ident attribute related patches (resend w/ testsuite v3)Henrik Grubbström (Grubba), Mar 29, 2010
  2. 1/5 convert: Safer handling of $Id$ contraction.Henrik Grubbström (Grubba), Mar 29, 2010
  3. 2/5 convert: Keep foreign $Id$ on checkout.Henrik Grubbström (Grubba), Mar 29, 2010
  4. 3/5 convert: Use the enum constant SAFE_CRLF_FALSE.Henrik Grubbström (Grubba), Mar 29, 2010
  5. 4/5 convert: Inhibit contraction of foreign $Id$ during stats.Henrik Grubbström (Grubba), Mar 29, 2010
  6. 5/5 convert: Added core.refilteronadd feature.Henrik Grubbström (Grubba), Mar 29, 2010
  7. Stephen R. van den BergMar 29, 2010
  8. Stephen R. van den BergMar 29, 2010
  9. Junio C HamanoApr 1, 2010
  10. Henrik GrubbströmApr 6, 2010
  11. Stephen R. van den BergMar 29, 2010
  12. Junio C HamanoApr 1, 2010
  13. Stephen R. van den BergMar 29, 2010
  14. Stephen R. van den BergMar 29, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.