X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=fast-import.c;h=73e5439d97481a0e4dcaa17d025b27ec3fdcf41b;hb=a1c0dca43a3513574e5bebb38989671960cdaf35;hp=7f197d5e36ae977e21251dbb45fa72973ea7830f;hpb=5c9afcff1aa048abf95296231d51fa481304a735;p=git.git diff --git a/fast-import.c b/fast-import.c index 7f197d5e3..73e5439d9 100644 --- a/fast-import.c +++ b/fast-import.c @@ -1516,6 +1516,8 @@ static int update_branch(struct branch *b) struct ref_lock *lock; unsigned char old_sha1[20]; + if (is_null_sha1(b->sha1)) + return 0; if (read_ref(b->name, old_sha1)) hashclr(old_sha1); lock = lock_any_ref_for_update(b->name, old_sha1, 0); @@ -2291,7 +2293,8 @@ static void cmd_reset_branch(void) else b = new_branch(sp); read_next_command(); - if (!cmd_from(b) && command_buf.len > 0) + cmd_from(b); + if (command_buf.len > 0) unread_command_buf = 1; }