Re: [PATCH v4 24/27] prune: strategies for linked checkouts
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 5, 2014, 20:07 UTC
- Message-ID
- <xmqqd2i0h0j3.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <1393675983-3232-25-git-send-email-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
Show 10 quoted lines
> + if (get_device_or_die(path) != get_device_or_die(get_git_dir())) {
> + strbuf_reset(&sb);
> + strbuf_addf(&sb, "%s/locked", sb_repo.buf);
> + write_file(sb.buf, 1, "located on a different file system\n");
> + keep_locked = 1;
> + } else {
> + strbuf_reset(&sb);
> + strbuf_addf(&sb, "%s/link", sb_repo.buf);
> + (void)link(sb_git.buf, sb.buf);
> + }Just in case you did not realize, casting the return away with (void) will not squelch this out of the compiler:
builtin/checkout.c: In function 'prepare_linked_checkout':
builtin/checkout.c:947:3: error: ignoring return value of 'link', declared with attribute warn_unused_result [-Werror=unused-result]It still feels fishy to see "we attempt to link but we do not care if it works or not" to me, with or without the "unused result" issue.