Re: [PATCH] More readable 'Not a git repository' messages

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

 



Hi Duy,

How about this and avoid adding cwd_orig?

-                               cwd[offset] = '\0';
-                               die("Not a git repository (or any
parent up to mount parent %s)\n"
-                               "Stopping at filesystem boundary
(GIT_DISCOVERY_ACROSS_FILESYSTEM not set).", cwd);
+                               die("Not in a git repository: %s\n"
+                               "(stopped searching at %.*s because "
+                               "GIT_DISCOVERY_ACROSS_FILESYSTEM is
not set)", cwd, offset, cwd);

this code is inside a loop that goes up in the directory hierarchy. So cwd[offset] = '\0' does not only happen once before dying. Maybe it could be done without copying but I thought keeping a copy of the unaltered path might be more readable.

--
Ralf

--
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]