pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/gitgitgadget/gitgitgadget/commit/eccd2cbc65a7505a88d991f148d7a636d559416f

notes: optionally accept a token to push with · gitgitgadget/gitgitgadget@eccd2cb · GitHub
Skip to content

Commit eccd2cb

Browse files
committed
notes: optionally accept a token to push with
Previously, the token was automagically looked up via the Git config. However, it is better to be less automagic about it, and pass it through from the `CIHelper` (who will learn about the token in the next commits). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 20410eb commit eccd2cb

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

lib/git-notes.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,16 @@ type TemporaryNoteIndex = {
1919
};
2020

2121
export class GitNotes {
22-
public async push(url: string) {
22+
public async push(url: string, token: string | undefined = undefined): Promise<void> {
23+
const auth = !token
24+
? []
25+
: [
26+
"-c",
27+
`http.extraheader=Authorization: Basic ${Buffer.from(`x-access-token:${token}`).toString("base64")}`,
28+
];
2329
for (const backoff of [50, 500, 2000, 5000, 20000, 0]) {
2430
try {
25-
await git(["push", url, "--", `${this.notesRef}`], {
31+
await git([...auth, "push", url, "--", `${this.notesRef}`], {
2632
workDir: this.workDir,
2733
});
2834
} catch (e) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy