MCPcopy Create free account
hub / github.com/decaporg/decap-cms / fetchFileMetadata

Method fetchFileMetadata

packages/decap-cms-backend-gitlab/src/API.ts:378–392  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

376
377 async readFileMetadata(path: string, sha: string | null | undefined) {
378 const fetchFileMetadata = async () => {
379 try {
380 const result: GitLabCommit[] = await this.requestJSON({
381 url: `${this.repoURL}/repository/commits`,
382 params: { path, ref_name: this.branch },
383 });
384 const commit = result[0];
385 return {
386 author: commit.author_name || commit.author_email,
387 updatedOn: commit.authored_date,
388 };
389 } catch (e) {
390 return { author: '', updatedOn: '' };
391 }
392 };
393 const fileMetadata = await readFileMetadata(sha, fetchFileMetadata, localForage);
394 return fileMetadata;
395 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected