Thread (6 messages) flat view 6 messages, 2 authors, 2016-06-15

Re: [PATCH] git-cvsimport: fix initial checkout

From: Martin Langhoff <hidden>
Date: 2016-06-15 22:44:23

Marc-Andre Lureau wrote:
git-symbolic-ref HEAD returns master reference, even if the file does
not exists. That prevents the initial checkout and fails in
git-rev-parse.
But you are patching the block that gets triggered on subsequent
imports, this code does not deal with "initial checkout" unless
something else is wrong. The line right above the open() is an else that
has the block that matters.
The patch checks the existence of the reference file
before assuming an original branch exists. There might be better
solutions than checking file existence.
There are indeed. If we need this patch -- then you can call git
ref-parse right to see if you get a sha1.
-	unless ($last_branch) {
+	if (-f "$git_dir/$last_branch") {
Note that the file won't exist there in any modern git. It will be in
$git_dir/refs/heads/$last_branch. Did you test this patch?

What's your workflow with cvsimport? Perhaps you are doing something
strange with it... :-)

cheers,


martin
-- 
-----------------------------------------------------------------------
Martin @ Catalyst .Net .NZ  Ltd, PO Box 11-053, Manners St,  Wellington
WEB: http://catalyst.net.nz/           PHYS: Level 2, 150-154 Willis St
NZ: +64(4)916-7224    MOB: +64(21)364-017    UK: 0845 868 5733 ext 7224
      Make things as simple as possible, but no simpler - Einstein
-----------------------------------------------------------------------
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help