Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEyvind Bernhardsen <eyvind-git@orakel.ntnu.no>2008-03-16 22:49:09 +0300
committerJunio C Hamano <gitster@pobox.com>2008-03-17 00:24:32 +0300
commit198724ad4ef0630892e8dbbab92e92ff4f979075 (patch)
tree312c7db7db3f1c6517ebd34d5faadfe074b27a10
parent20fd60bf6a0cbcd77c7b1f5b3b8bda224f896d60 (diff)
fast-import: Allow "reset" to delete a new branch without error
Creating a branch in fast-import and then resetting it without making any further commits to it currently causes an error message at the end of the import. This error is triggered by cvs2svn's git backend, which uses a temporary fixup branch when it creates tags, because the fixup branch is reset after each tag. This patch prevents the error, allowing "reset" to be used to delete temporary branches. Signed-off-by: Eyvind Bernhardsen <eyvind-git@orakel.ntnu.no> Acked-by: Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--fast-import.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fast-import.c b/fast-import.c
index 655913ddb2..73e5439d97 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);