Subject: [PATCH] Cleanup remove_path

From: Alex Riesen <[email-masked]>
Date: Thu, 25 Sep 2008 22:17:34 +0200

Signed-off-by: Alex Riesen <[email-masked]>
---

While at it, could we cleanup the remove_file routines a little?

 builtin-merge-recursive.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/builtin-merge-recursive.c b/builtin-merge-recursive.c
index a29b47f..dc9652d 100644
--- a/builtin-merge-recursive.c
+++ b/builtin-merge-recursive.c
@@ -418,12 +418,10 @@ static int update_stages(const char *path, struct diff_filespec *o,
 
 static int remove_path(const char *name)
 {
-	int ret;
 	char *slash, *dirs;
 
-	ret = unlink(name);
-	if (ret)
-		return ret;
+	if (unlink(name))
+		return -1;
 	dirs = xstrdup(name);
 	while ((slash = strrchr(name, '/'))) {
 		*slash = '\0';
@@ -431,7 +429,7 @@ static int remove_path(const char *name)
 			break;
 	}
 	free(dirs);
-	return ret;
+	return 0;
 }
 
 static int remove_file(int clean, const char *path, int no_wd)
-- 
1.6.0.2.328.g14651