aboutsummaryrefslogtreecommitdiff
path: root/builtin/rm.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-06-16 14:33:47 -0700
committerJunio C Hamano <gitster@pobox.com>2015-06-16 14:33:47 -0700
commitdfb67594e964e63f20546361597c06432c73779d (patch)
tree3ea858127e139ee620a010f4ba82aa95b9fca77c /builtin/rm.c
parent2cd8ebdd3d28359b7886d994e84a8725394935e7 (diff)
parent22570b68e3cb9380403d903680be3b3112a26490 (diff)
downloadgit-dfb67594e964e63f20546361597c06432c73779d.tar.gz
git-dfb67594e964e63f20546361597c06432c73779d.tar.xz
Merge branch 'rs/janitorial' into maint
Code clean-up. * rs/janitorial: dir: remove unused variable sb clean: remove unused variable buf use file_exists() to check if a file exists in the worktree
Diffstat (limited to 'builtin/rm.c')
-rw-r--r--builtin/rm.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/builtin/rm.c b/builtin/rm.c
index 3304bff42..80b972f92 100644
--- a/builtin/rm.c
+++ b/builtin/rm.c
@@ -84,7 +84,6 @@ static int check_submodules_use_gitfiles(void)
const char *name = list.entry[i].name;
int pos;
const struct cache_entry *ce;
- struct stat st;
pos = cache_name_pos(name, strlen(name));
if (pos < 0) {
@@ -95,7 +94,7 @@ static int check_submodules_use_gitfiles(void)
ce = active_cache[pos];
if (!S_ISGITLINK(ce->ce_mode) ||
- (lstat(ce->name, &st) < 0) ||
+ !file_exists(ce->name) ||
is_empty_dir(name))
continue;