threads / discuss / 12994

git clone error

Subject: git clone error

## tl;dr

2 messages between Apr 5, 2008 and Apr 5, 2008.

replies: 1people: 2as markdown or json

Chuck Ritter· Apr 5, 2008, 17:20 UTC · lore
Hello,
I'm getting an error when I try to clone a git repo:

$ git clone ~dab143/src/OVER-REL/SOURCE-GIT-TEST OVER-REL Initialized empty Git repository in /home/cfr100/OVER-REL/.git/ cpio: objects/pack/pack-80a0460fc07be5e0628b02549fdaa186b792d3f3.keep: Permission denied 888 blocks

# cat pack-80a0460fc07be5e0628b02549fdaa186b792d3f3.keep fetch-pack 31620 on githost.arl.psu.edu

Permission on the keep file are 600. Of course this looks like a stale lock of some sort.

We are using git version 1.5.4.1. The owner of the repository had pushed changes to it from msysgit under Windows. I am not sure of the version. It worked fine before that.

Is this an issue I should take up with the msysgit developers?

Once in this state what is the best way to resolve it and verify the integrity of the repository?

Thanks Chuck

Junio C Hamano· Apr 5, 2008, 20:09 UTC · re: Chuck Ritter · lore

Re: git clone error

"Chuck Ritter" <cfr100@psu.edu> writes:
Show 11 quoted lines
> $ git clone ~dab143/src/OVER-REL/SOURCE-GIT-TEST OVER-REL
> Initialized empty Git repository in /home/cfr100/OVER-REL/.git/
> cpio: objects/pack/pack-80a0460fc07be5e0628b02549fdaa186b792d3f3.keep:
> Permission denied
> 888 blocks
>
> # cat pack-80a0460fc07be5e0628b02549fdaa186b792d3f3.keep
> fetch-pack 31620 on githost.arl.psu.edu
>
> Permission on the keep file are 600. Of course this looks like a stale
> lock of some sort.

The original repository you are cloning from is owned by somebody else, and a file in it is not readable by you. Bad.

No, .keep is not a stale lock. It is active and valid --- do not remove it --- it prevents the corresponding pack from being subject to repacking.

The bug is that index-pack.c::final() tries to make the resulting pack and idx readable with chmod(0444), but it forgets to make .keep readable.

To unblock you, you would need to ask the user "dab143" to make the repository readable by you; the damage has already been done. There may be files other than that .keep file that is unreadable.

The following patch would prevent the breakage the repository you are trying to clone from is suffering from happening again.

---
 index-pack.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/index-pack.c b/index-pack.c
index 9c0c278..9dc3cfd 100644
--- a/index-pack.c
+++ b/index-pack.c
@@ -720,6 +720,7 @@ static void final(const char *final_pack_name, const char *curr_pack_name,
 				die("cannot write keep file");
 			report = "keep";
 		}
+		chmod(keep_name, 0444);
 	}
 
 	if (final_pack_name != curr_pack_name) {

← back to recent threads