summaryrefslogtreecommitdiff
path: root/rev-parse.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-03-27 07:44:14 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-03-27 07:44:14 (GMT)
commitd93067d9c7fb210766c7282d662289f54d53f93a (patch)
treea463ad3ce94a987ec3d00e10eaa98ede1fe0495d /rev-parse.c
parentf4e96f97e85c145616bc2e23e9441bc0daa2906e (diff)
parentb0a3de42316a4e8f1d561cbe12b7bb282631a0d6 (diff)
downloadgit-d93067d9c7fb210766c7282d662289f54d53f93a.zip
git-d93067d9c7fb210766c7282d662289f54d53f93a.tar.gz
git-d93067d9c7fb210766c7282d662289f54d53f93a.tar.bz2
Merge branch 'master' into next
* master: Optionally do not list empty directories in git-ls-files --others Document git-rebase behavior on conflicts. Fix error handling for nonexistent names
Diffstat (limited to 'rev-parse.c')
-rw-r--r--rev-parse.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/rev-parse.c b/rev-parse.c
index 19a5ef7..f176c56 100644
--- a/rev-parse.c
+++ b/rev-parse.c
@@ -172,9 +172,11 @@ int main(int argc, char **argv)
struct stat st;
char *arg = argv[i];
char *dotdot;
-
+
if (as_is) {
- show_file(arg);
+ if (show_file(arg) && as_is < 2)
+ if (lstat(arg, &st) < 0)
+ die("'%s': %s", arg, strerror(errno));
continue;
}
if (!strcmp(arg,"-n")) {
@@ -194,7 +196,7 @@ int main(int argc, char **argv)
if (*arg == '-') {
if (!strcmp(arg, "--")) {
- as_is = 1;
+ as_is = 2;
/* Pass on the "--" if we show anything but files.. */
if (filter & (DO_FLAGS | DO_REVS))
show_file(arg);