X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-fetch-pack.c;h=67fb80ec48d6d8f0327628afd86fb366d8f97617;hb=c841aa8b903200f5d7830c7c4ab8d62b5ef44c5c;hp=fa3c936493cc0b139edf3e4e8154569f453afc02;hpb=e782e12f89955dfb0be82098af3cfdd8dd0eaf80;p=git.git diff --git a/builtin-fetch-pack.c b/builtin-fetch-pack.c index fa3c93649..67fb80ec4 100644 --- a/builtin-fetch-pack.c +++ b/builtin-fetch-pack.c @@ -780,7 +780,8 @@ struct ref *fetch_pack(struct fetch_pack_args *my_args, 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; @@ -813,7 +814,8 @@ struct ref *fetch_pack(struct fetch_pack_args *my_args, ) 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);