Cleanup remove_path
Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
This commit is contained in:
parent
ed520a8f27
commit
eb53586ba9
@ -394,12 +394,10 @@ static int update_stages(const char *path, struct diff_filespec *o,
|
|||||||
|
|
||||||
static int remove_path(const char *name)
|
static int remove_path(const char *name)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
char *slash, *dirs;
|
char *slash, *dirs;
|
||||||
|
|
||||||
ret = unlink(name);
|
if (unlink(name))
|
||||||
if (ret)
|
return -1;
|
||||||
return ret;
|
|
||||||
dirs = xstrdup(name);
|
dirs = xstrdup(name);
|
||||||
while ((slash = strrchr(name, '/'))) {
|
while ((slash = strrchr(name, '/'))) {
|
||||||
*slash = '\0';
|
*slash = '\0';
|
||||||
@ -407,7 +405,7 @@ static int remove_path(const char *name)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
free(dirs);
|
free(dirs);
|
||||||
return ret;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int remove_file(struct merge_options *o, int clean,
|
static int remove_file(struct merge_options *o, int clean,
|
||||||
|
Loading…
Reference in New Issue
Block a user