aboutsummaryrefslogtreecommitdiff
path: root/merge-recursive.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-06-01 12:45:15 -0700
committerJunio C Hamano <gitster@pobox.com>2015-06-01 12:45:15 -0700
commit4ba5bb5531c6ec64a57ae2754ba51ce477eebaf0 (patch)
tree7aa6825956056e5f88630a83a91aa085135c031d /merge-recursive.c
parentf693bb0bb0d18d6150d6059dfad5018501a9713a (diff)
parent22570b68e3cb9380403d903680be3b3112a26490 (diff)
downloadgit-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 'merge-recursive.c')
-rw-r--r--merge-recursive.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/merge-recursive.c b/merge-recursive.c
index 1c9c30db6..44d85bea4 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -611,7 +611,6 @@ static char *unique_path(struct merge_options *o, const char *path, const char *
{
struct strbuf newpath = STRBUF_INIT;
int suffix = 0;
- struct stat st;
size_t base_len;
strbuf_addf(&newpath, "%s~", path);
@@ -620,7 +619,7 @@ static char *unique_path(struct merge_options *o, const char *path, const char *
base_len = newpath.len;
while (string_list_has_string(&o->current_file_set, newpath.buf) ||
string_list_has_string(&o->current_directory_set, newpath.buf) ||
- lstat(newpath.buf, &st) == 0) {
+ file_exists(newpath.buf)) {
strbuf_setlen(&newpath, base_len);
strbuf_addf(&newpath, "_%d", suffix++);
}