Subject: [PATCH] setup.c: make check_filename() return 0 on ENAMETOOLONG

From: Nguyễn Thái Ngọc Duy <[email-masked]>
Date: Sun, 7 Feb 2016 06:23:12 +0700

Noticed-by: Ole Tange <[email-masked]>
Signed-off-by: Nguyễn Thái Ngọc Duy <[email-masked]>
---
 On Sun, Feb 7, 2016 at 4:56 AM, Ole Tange <[email-masked]> wrote:
 > If file name too long it should just try to see if it is a reference
 > to a revision.

 Looks easy enough to fix.

 setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/setup.c b/setup.c
index 2c4b22c..ab8f85d 100644
--- a/setup.c
+++ b/setup.c
@@ -147,7 +147,7 @@ int check_filename(const char *prefix, const char *arg)
 		name = arg;
 	if (!lstat(name, &st))
 		return 1; /* file exists */
-	if (errno == ENOENT || errno == ENOTDIR)
+	if (errno == ENOENT || errno == ENOTDIR || errno == ENAMETOOLONG)
 		return 0; /* file does not exist */
 	die_errno("failed to stat '%s'", arg);
 }
-- 
2.7.0.377.g4cd97dd