diff --git a/builtin-fetch-pack.c b/builtin-fetch-pack.c
index 85509f5ee5884589980c9a1c5f96b66a3d49d5dd..22a57121a8cd58c43008e46fec4a4b8348310724 100644 (file)
--- a/builtin-fetch-pack.c
+++ b/builtin-fetch-pack.c
struct ref *ref_cpy;
fetch_pack_setup();
- memcpy(&args, my_args, sizeof(args));
+ if (&args != my_args)
+ memcpy(&args, my_args, sizeof(args));
if (args.depth > 0) {
if (stat(git_path("shallow"), &st))
st.st_mtime = 0;
)
die("shallow file was changed during fetch");
- fd = hold_lock_file_for_update(&lock, shallow, 1);
+ fd = hold_lock_file_for_update(&lock, shallow,
+ LOCK_DIE_ON_ERROR);
if (!write_shallow_commits(fd, 0)) {
unlink(shallow);
rollback_lock_file(&lock);