summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 92643a2)
raw | patch | inline | side by side (parent: 92643a2)
author | Linus Torvalds <torvalds@osdl.org> | |
Wed, 25 Jan 2006 22:00:37 +0000 (17:00 -0500) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 25 Jan 2006 22:44:52 +0000 (14:44 -0800) |
If you pass it a filename without the "--" marker to separate it from
revision information and flags, we now require that the file in question
actually exists. This makes mis-typed revision information not be silently
just considered a strange filename.
With the "--" marker, you can continue to pass in filenames that do not
actually exists - useful for querying what happened to a file that you
no longer have in the repository.
[ All scripts should use the "--" format regardless, to make things
unambiguous. So this change should not affect any existing tools ]
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
revision information and flags, we now require that the file in question
actually exists. This makes mis-typed revision information not be silently
just considered a strange filename.
With the "--" marker, you can continue to pass in filenames that do not
actually exists - useful for querying what happened to a file that you
no longer have in the repository.
[ All scripts should use the "--" format regardless, to make things
unambiguous. So this change should not affect any existing tools ]
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
rev-list.c | patch | blob | history | |
rev-parse.c | patch | blob | history |
diff --git a/rev-list.c b/rev-list.c
index d0609666a1c5732aa9bc9359d70fd3cf65555c29..e00e6fc76df8236c925e904fa270a2293099d6cf 100644 (file)
--- a/rev-list.c
+++ b/rev-list.c
arg++;
limited = 1;
}
- if (get_sha1(arg, sha1) < 0)
+ if (get_sha1(arg, sha1) < 0) {
+ struct stat st;
+ if (lstat(arg, &st) < 0)
+ die("'%s': %s", arg, strerror(errno));
break;
+ }
commit = get_commit_reference(arg, sha1, flags);
handle_one_commit(commit, &list);
}
diff --git a/rev-parse.c b/rev-parse.c
index 0c951af0d49da459fc6c85c32707b016bf581a57..7abad35de90b190c5d5e5456661853cf8167954a 100644 (file)
--- a/rev-parse.c
+++ b/rev-parse.c
const char *prefix = setup_git_directory();
for (i = 1; i < argc; i++) {
+ struct stat st;
char *arg = argv[i];
char *dotdot;
}
if (verify)
die("Needed a single revision");
+ if (lstat(arg, &st) < 0)
+ die("'%s': %s", arg, strerror(errno));
as_is = 1;
show_file(arg);
}