From: Alex Riesen Date: Thu, 25 Sep 2008 20:17:34 GMT Subject: [PATCH] Cleanup remove_path Message-ID: <20080925201734.GA18315@blimp.localhost> In-Reply-To: <20080925201245.GB3959@blimp.localhost> Signed-off-by: Alex Riesen --- 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