Re: [PATCH] crlf: Add test showing double warning on commit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 14.05.16 13:17, Adam Dinwoodie wrote:
> Add failing test case showing CRLF -> LF rewrite warnings being printed
> multiple times when running "git commit".
>

The problem seems to come from this line:

index 5473493..59d4106 100644
--- a/diffcore-break.c
+++ b/diffcore-break.c
@@ -61,9 +61,18 @@ static int should_break(struct diff_filespec *src,
            !hashcmp(src->sha1, dst->sha1))
                return 0; /* they are the same */
 
+       fprintf(stderr, "%s:%d src-path=%s dst-path=%s\n",
+               __FILE__, __LINE__, src->path, dst->path);
+#if 0
        if (diff_populate_filespec(src, 0) || diff_populate_filespec(dst, 0))
                return 0; /* error but caught downstream */
+#else
 
+       if (diff_populate_filespec(src, 0))
+               return 0; /* error but caught downstream */
+       if (strcmp(src->path, dst->path) && diff_populate_filespec(dst, 0))
+               return 0; /* error but caught downstream */
+#endif
        max_size = ((src->size > dst->size) ? src->size : dst->size);

Do we need to run diff_populate_filespec() twice when src==dst ?
If yes, we may need to introduce a flag besides
#define CHECK_SIZE_ONLY 1
#define CHECK_BINARY    2
to suppress the conversion warning ??

If no, the fix from above should do ?

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]