This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Trouble with cygwin git


> I'm having the problem cloning a git repository using
> Cygwin git 1.5.3.5:
> 
> [...]
> 
> fatal: failed to unpack tree object HEAD
> 

I dug into this, and found that the failure happens here:

    res = fh->link (newpath);

in the link() function of file src/winsup/cygwin/syscalls.cc.  res is -1, and 
errno == EEXIST at this point.

In the call above, newpath is:
/cygdrive/c/git/git/.git/objects/pack/pack-
d629a7029e3a941884c4bea2b33cc27e32f55779.pack

Digging further, this line fails:

    if (CreateHardLinkA (newpc, pc, NULL))
      goto success;

in function fhandler_disk_file::link(), fhandler_disk_file.cc.  CreateHardLinkA
() returns 0, and GetLastError() returns 183 (ERROR_ALREADY_EXISTS: Cannot 
create a file when that file already exists).

In the CreateHardLinkA() call above, newpc.get_win32() yields:
c:\git\git\.git\objects\pack\pack-d629a7029e3a941884c4bea2b33cc27e32f55779.pack

pc.get_win32() yields:
c:\git\git\.git\objects\tmp_pack_btsO9s

I know that the destination file (newpc) does not exist; so I am perplexed why 
CreateHardLinkA() is failing.  In the CreateHardLink() documentation on MSDN, 
I see this comment:

"if you open a file that does not allow sharing, another application cannot 
share the file by creating a new hard link to the file"

However, I see that all calls to CreateFile() in XP Cygwin happen with:

FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE

Any ideas why CreateHardLinkA() could still be failing?


Thanks,
MP


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]