Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2006-09-08 12:05:34 +0400
committerJunio C Hamano <junkio@cox.net>2006-09-09 03:46:35 +0400
commitc91f0d92efb36d7b349f586cafafaf0e6ac3f5b2 (patch)
tree9f328dd9bbc033e3c3d50a43d0a08ebfe6bd0d79 /dir.c
parent7c92fe0eaa4fb89e27fa3617b9ae52f20b511573 (diff)
git-commit.sh: convert run_status to a C builtin
This creates a new git-runstatus which should do roughly the same thing as the run_status function from git-commit.sh. Except for color support, the main focus has been to keep the output identical, so that it can be verified as correct and then used as a C platform for other improvements to the status printing code. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/dir.c b/dir.c
index 5a40d8ff8c..e2f472ba7f 100644
--- a/dir.c
+++ b/dir.c
@@ -397,3 +397,10 @@ int read_directory(struct dir_struct *dir, const char *path, const char *base, i
qsort(dir->entries, dir->nr, sizeof(struct dir_entry *), cmp_name);
return dir->nr;
}
+
+int
+file_exists(const char *f)
+{
+ struct stat sb;
+ return stat(f, &sb) == 0;
+}