@@ -147,10 +147,6 @@ func (idx *Index) Clear() {
147147}
148148
149149// Paths returns a slice of all staged file paths.
150- // The returned slice is a copy and can be safely modified.
151- //
152- // Returns:
153- // - Slice of relative paths for all staged files
154150func (idx * Index ) Paths () []scpath.RelativePath {
155151 paths := make ([]scpath.RelativePath , len (idx .Entries ))
156152 for i , e := range idx .Entries {
@@ -160,8 +156,6 @@ func (idx *Index) Paths() []scpath.RelativePath {
160156}
161157
162158// Count returns the total number of staged files in the index.
163- //
164- // Returns the number of entries.
165159func (idx * Index ) Count () int {
166160 return len (idx .Entries )
167161}
@@ -210,11 +204,6 @@ func (idx *Index) Serialize(w io.Writer) error {
210204// - Signature: "DIRC" (4 bytes)
211205// - Version: uint32 big-endian (4 bytes)
212206// - Entry count: uint32 big-endian (4 bytes)
213- //
214- // Parameters:
215- // - w: Writer to output the header
216- //
217- // Returns an error if any write operation fails.
218207func (idx * Index ) writeHeader (w io.Writer ) error {
219208 if _ , err := w .Write ([]byte (IndexSignature )); err != nil {
220209 return fmt .Errorf ("failed to write signature: %w" , err )
@@ -276,13 +265,6 @@ func (idx *Index) Deserialize(r io.Reader) error {
276265
277266// validateChecksum verifies the SHA-1 checksum of the index data.
278267// This ensures the index file hasn't been corrupted or tampered with.
279- //
280- // Parameters:
281- // - data: Complete index file data including checksum
282- //
283- // Returns an error if:
284- // - Data is too small to contain a checksum
285- // - Calculated checksum doesn't match stored checksum
286268func validateChecksum (data []byte ) error {
287269 if len (data ) < IndexHeaderSize + IndexChecksumSize {
288270 return fmt .Errorf ("invalid index file: too small" )
@@ -301,14 +283,6 @@ func validateChecksum(data []byte) error {
301283
302284// readHeader reads and validates the 12-byte index header.
303285// Initializes the Entries slice based on the entry count from the header.
304- //
305- // Parameters:
306- // - r: Reader positioned at the start of the index data
307- //
308- // Returns an error if:
309- // - Signature is not "DIRC"
310- // - Version is not supported (currently only version 2)
311- // - Any read operation fails
312286func (idx * Index ) readHeader (r io.Reader ) error {
313287 sig := make ([]byte , 4 )
314288 if _ , err := io .ReadFull (r , sig ); err != nil {
0 commit comments