summaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
authorRonnie Sahlberg <sahlberg@google.com>2014-07-16 18:01:18 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-10-15 17:47:20 (GMT)
commit1054af7d04aef64378d69a0496b45cdbf6a0bef2 (patch)
tree3387241e7b60dfaf8e8195ec4d161aa31fdb7f54 /refs.c
parent2b2b1e4d27b4e44c0c46d4857c76b8391d303af3 (diff)
downloadgit-1054af7d04aef64378d69a0496b45cdbf6a0bef2.zip
git-1054af7d04aef64378d69a0496b45cdbf6a0bef2.tar.gz
git-1054af7d04aef64378d69a0496b45cdbf6a0bef2.tar.bz2
wrapper.c: remove/unlink_or_warn: simplify, treat ENOENT as success
Simplify the function warn_if_unremovable slightly. Additionally, change behaviour slightly. If we failed to remove the object because the object does not exist, we can still return success back to the caller since none of the callers depend on "fail if the file did not exist". Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/refs.c b/refs.c
index a77458f..2dcf6c6 100644
--- a/refs.c
+++ b/refs.c
@@ -2607,7 +2607,7 @@ static int delete_ref_loose(struct ref_lock *lock, int flag)
char *loose_filename = get_locked_file_path(lock->lk);
int err = unlink_or_warn(loose_filename);
free(loose_filename);
- if (err && errno != ENOENT)
+ if (err)
return 1;
}
return 0;