Fast implementation of Git in pure Go codeberg.org/lindenii/furgit
git go
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

object/signed/commit: Fix whitespace

Runxi Yu d0505e1e 8b1de480

+11
+4
object/signed/commit/integration_test.go
··· 21 21 testRepo := testgit.NewRepo(t, testgit.RepoOptions{ObjectFormat: algo}) 22 22 23 23 signDir := t.TempDir() 24 + 24 25 signRoot, err := os.OpenRoot(signDir) 25 26 if err != nil { 26 27 t.Fatalf("os.OpenRoot(%q): %v", signDir, err) ··· 40 41 "-C", "runxiyu@umich.edu", 41 42 "-f", privateKeyPath, 42 43 ) //#nosec G204 44 + 43 45 out, err := cmd.CombinedOutput() 44 46 if err != nil { 45 47 t.Fatalf("ssh-keygen generate failed: %v\n%s", err, out) ··· 102 104 "-s", signaturePath, 103 105 ) //#nosec G204 104 106 cmd.Stdin = bytes.NewReader(payload) 107 + 105 108 out, err := cmd.CombinedOutput() 106 109 if err != nil { 107 110 t.Fatalf("ssh-keygen verify failed: %v\n%s", err, out) ··· 126 129 "-s", signaturePath, 127 130 ) //#nosec G204 128 131 cmd.Stdin = bytes.NewReader(payload) 132 + 129 133 out, err := cmd.CombinedOutput() 130 134 if err == nil { 131 135 t.Fatalf("ssh-keygen verify unexpectedly succeeded:\n%s", out)
+3
object/signed/commit/parse.go
··· 25 25 26 26 rel := bytes.IndexByte(body[i:], '\n') 27 27 next := len(body) 28 + 28 29 lineEnd := len(body) 29 30 if rel >= 0 { 30 31 lineEnd = i + rel ··· 63 64 for i < len(body) { 64 65 rel := bytes.IndexByte(body[i:], '\n') 65 66 next = len(body) 67 + 66 68 lineEnd = len(body) 67 69 if rel >= 0 { 68 70 lineEnd = i + rel ··· 70 72 } 71 73 72 74 contStart := i 75 + 73 76 cont := body[contStart:lineEnd] 74 77 if len(cont) == 0 || cont[0] != ' ' { 75 78 break
+4
object/signed/commit/unit_test.go
··· 40 40 } 41 41 42 42 gotPayload := string(commit.AppendPayload(nil)) 43 + 43 44 wantPayload := "" + 44 45 "tree 0cfbf08886fca9a91cb753ec8734c84fcbe52c9f\n" + 45 46 "parent 9da738312d24ef0a29be2c8c2b6fc5cf7085a293\n" + ··· 86 87 } 87 88 88 89 gotAlgorithms := commit.Algorithms() 90 + 89 91 wantAlgorithms := []objectid.Algorithm{ 90 92 objectid.AlgorithmSHA1, 91 93 objectid.AlgorithmSHA256, ··· 111 113 } 112 114 113 115 gotPayload := string(commit.AppendPayload(nil)) 116 + 114 117 wantPayload := "" + 115 118 "tree deadbeef\n" + 116 119 "\n" + ··· 142 145 } 143 146 144 147 gotPayload := string(commit.AppendPayload(nil)) 148 + 145 149 wantPayload := "" + 146 150 "tree deadbeef\n" + 147 151 "\n" +