1

I hope you are doing well. I am faced with a challenge, I have to retrieve the pack-*.pack filename from a git repository freshly cloned from remote:

- Without being able to list the contents of a folder
- There is no .git/objects/info/packs
- There is no .git/objects/http-alternates
- I can access any file, only If I know its name, for example, I can access .git/config or .git/HEAD, but to access pack files I have to know their names, and listing the .git/objects/packs directory is not allowed.

I have access to the .git/index and any other FILE(not folder, but file), so basically I have to guess the correct filename of any pack-*.pack file available, I read some documentation, but I am not able to find anything.

Melardev
  • 1,101
  • 10
  • 22
  • 1
    You cannot *guess* the name. The name is a SHA-1 checksum of its content. If you know all its content, you can *compute* the name, but if you know its content already, you probably don't need to retrieve the file, as you already have all of its data. – torek May 02 '20 at 12:58
  • @totrek how does git know about the pack filename then? listing the directory? or retrieving it from a file(such as .git/index, which I know it does not contain that info, it was just for the example). – Melardev May 02 '20 at 15:19
  • 1
    Git reads the directory looking for files named `*.pack` and `*.idx`. The idx files index the corresponding pack file. – torek May 02 '20 at 15:36
  • @torek ok so no solution for the problem =(, thanks for the response – Melardev May 02 '20 at 16:06

0 Answers0