diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-06-01 12:45:15 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-06-01 12:45:15 -0700 |
commit | 4ba5bb5531c6ec64a57ae2754ba51ce477eebaf0 (patch) | |
tree | 7aa6825956056e5f88630a83a91aa085135c031d /submodule.c | |
parent | f693bb0bb0d18d6150d6059dfad5018501a9713a (diff) | |
parent | 22570b68e3cb9380403d903680be3b3112a26490 (diff) | |
download | git-4ba5bb5531c6ec64a57ae2754ba51ce477eebaf0.tar.gz git-4ba5bb5531c6ec64a57ae2754ba51ce477eebaf0.tar.xz |
Merge branch 'rs/janitorial'
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 'submodule.c')
-rw-r--r-- | submodule.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/submodule.c b/submodule.c index d491e6a77..b8747f5c2 100644 --- a/submodule.c +++ b/submodule.c @@ -891,7 +891,6 @@ int submodule_uses_gitfile(const char *path) int ok_to_remove_submodule(const char *path) { - struct stat st; ssize_t len; struct child_process cp = CHILD_PROCESS_INIT; const char *argv[] = { @@ -904,7 +903,7 @@ int ok_to_remove_submodule(const char *path) struct strbuf buf = STRBUF_INIT; int ok_to_remove = 1; - if ((lstat(path, &st) < 0) || is_empty_dir(path)) + if (!file_exists(path) || is_empty_dir(path)) return 1; if (!submodule_uses_gitfile(path)) |