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

[PATCH] diff-cache path restriction fix.

From
Junio C Hamano <junkio@cox.net>
Date
May 25, 2005, 00:47 UTC
Message-ID
<7vu0ksrv1v.fsf@assigned-by-dhcp.cox.net>

It advertises the path restriction in documentation and usage string, but the argument parsing code was not updated and was causing it to refuse to run. One liner fix is here.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
# - linus: git-update-cache: allow dot-files
# + (working tree)
diff --git a/diff-cache.c b/diff-cache.c
--- a/diff-cache.c
+++ b/diff-cache.c
@@ -164,7 +164,7 @@ int main(int argc, const char **argv)
 	int ret;
 
 	read_cache();
-	while (argc > 2) {
+	while (1 < argc && argv[1][0] == '-') {
 		const char *arg = argv[1];
 		argv++;
 		argc--;
Next: Linus Torvalds
Message 1 of 17 in “diff-cache path restriction fix.”
  1. diff-cache path restriction fix.Junio C Hamano, May 25, 2005
  2. Linus TorvaldsMay 25, 2005
  3. Junio C HamanoMay 25, 2005
  4. Linus TorvaldsMay 25, 2005
  5. Junio C HamanoMay 25, 2005
  6. Russ AllberyMay 25, 2005
  7. Junio C HamanoMay 25, 2005
  8. Linus TorvaldsMay 25, 2005
  9. Junio C HamanoMay 25, 2005
  10. Ingo MolnarMay 25, 2005
  11. Linus TorvaldsMay 25, 2005
  12. Junio C HamanoMay 25, 2005
  13. Thomas GlanzmannMay 25, 2005
  14. Matthias UrlichsMay 25, 2005
  15. [OT] if (4 < number_of_children) you're in troubleJunio C Hamano, May 28, 2005
  16. Ingo MolnarMay 25, 2005
  17. Florian WeimerMay 25, 2005

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.