const char *prefix = setup_git_directory();
for (i = 1; i < argc; i++) {
+ struct stat st;
char *arg = argv[i];
char *dotdot;
puts(prefix);
continue;
}
+ if (!strcmp(arg, "--show-cdup")) {
+ const char *pfx = prefix;
+ while (pfx) {
+ pfx = strchr(pfx, '/');
+ if (pfx) {
+ pfx++;
+ printf("../");
+ }
+ }
+ putchar('\n');
+ continue;
+ }
if (!strcmp(arg, "--git-dir")) {
const char *gitdir = getenv(GIT_DIR_ENVIRONMENT);
static char cwd[PATH_MAX];
}
if (verify)
die("Needed a single revision");
+ if (lstat(arg, &st) < 0)
+ die("'%s': %s", arg, strerror(errno));
as_is = 1;
show_file(arg);
}