Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH v4 24/27] prune: strategies for linked checkouts

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:00:12

Nguyễn Thái Ngọc Duy  [off-list ref] writes:
+	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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help