chore(repository): add some more info via comments@@ -1,5 +1,5 @@
{
- "_generatedAtUnix": 1663840945689,
+ "_generatedAtUnix": 1663843732633,
"_hashAlgorithm": "sha1",
"_version": 2,
"islands": {
@@ -62,11 +62,11 @@
"pathSource": "./app/views/organization/OrganizationDetailsView.tsx"
},
"RepositoryBrowserView": {
- "hash": "932ee3dcdabd946d727876e494b58264c3043069",
+ "hash": "1a24dc89e650e755291fedb59b121467c1c8e6ab",
"pathSource": "./app/views/repository/RepositoryBrowserView.tsx"
},
"RepositoryCommitsLogView": {
- "hash": "7182aef2cd68058c2994e84e8019f87be0ee313a",
+ "hash": "cfb132fe26e998535c0c022d4796f35fd7913812",
"pathSource": "./app/views/repository/RepositoryCommitsLogView.tsx"
},
"RepositoryCompareView": {
@@ -33,6 +33,7 @@ const makeGetRepositoryCommitLog: ServiceMethodFactory<
}
const repoPath = `${Env.GIT_REPOSITORIES_ROOT}/${parentOrg.slug}/${repo.slug}.git`;
+
if (existsSync(repoPath) === false) {
throw new Error(`Could not find a valid git repository at: ${repoPath}`);
}
@@ -50,6 +51,7 @@ const makeGetRepositoryCommitLog: ServiceMethodFactory<
path != null && path.trim() !== "" ? "-p" : null,
path != null && path.trim() !== "" ? `${path}` : null,
].filter((x): x is string => x != null);
+
const gitLogProcess = spawn("git", args, {
cwd: repoPath,
});
@@ -66,7 +68,7 @@ const makeGetRepositoryCommitLog: ServiceMethodFactory<
let escapedJson = buffer.join("");
const fieldsToEscape = escapedJson.match(
- GIT_LOG_NEWLINEW_FINDER_REGEXP
+ GIT_LOG_NEWLINEW_FINDER_REGEXP // Find the fields that may contain \n for escaping them
);
if (fieldsToEscape != null && Array.isArray(fieldsToEscape)) {
@@ -80,11 +82,12 @@ const makeGetRepositoryCommitLog: ServiceMethodFactory<
escapedJson = escapedJson
.replace(/"/gm, '\\"') // Escape double-quotes: " -> \"
- .replace(/\^@\^/gm, '"'); // Escaped double-quotes back to double quotes
+ .replace(/\^@\^/gm, '"'); // Custom escape char back to real double quotes
try {
resolve(
JSON.parse(
+ // create a valid JSON array of commit objects
`[${escapedJson.substring(0, escapedJson.length - 1)}]`
)
);
@@ -49,12 +49,8 @@ const RepositoryBrowserView: ReactView<RepositoryBrowserViewProps> = ({
{" / "}
{path}
</h1>
- <Grid.Col fluid>
- <Grid.Row
- nowrap
- alignItems={"center"}
- style={{ width: "100%", marginTop: 16 }}
- >
+ <Grid.Col fluid style={{ marginTop: 16 }}>
+ <Grid.Row nowrap alignItems={"center"} style={{ width: "100%" }}>
<div>
<strong>lang:</strong> <span>{linguistInfos.language}</span>
</div>
@@ -33,7 +33,10 @@ const RepositoryCommitsLogView: ReactView<RepositoryCommitsLogViewProps> = ({
</a>
{" / Commits"}
</h1>
- <Card style={{ width: "100%" }} themeScheme={commonProps.themeScheme}>
+ <Card
+ style={{ width: "100%", marginTop: 32 }}
+ themeScheme={commonProps.themeScheme}
+ >
{history.map((log) => (
<a
key={log.tree}