Skip to content

Commit

Permalink
Handle YAML EntryType when git mirror remote to local
Browse files Browse the repository at this point in the history
  • Loading branch information
chacham committed Aug 2, 2021
1 parent 7ff6308 commit e5a5ccb
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,13 @@ protected void mirrorRemoteToLocal(File workDir, CommandExecutor executor,
final byte[] content = reader.open(objectId).getBytes();
switch (EntryType.guessFromPath(localPath)) {
case JSON:
final JsonNode jsonNode = Jackson.readTree(content);
final JsonNode jsonNode = Jackson.readTree(content, EntryType.JSON);
changes.putIfAbsent(localPath, Change.ofJsonUpsert(localPath, jsonNode));
break;
case YAML:
final JsonNode yamlNode = Jackson.readTree(content, EntryType.YAML);
changes.putIfAbsent(localPath, Change.ofYamlUpsert(localPath, yamlNode));
break;
case TEXT:
final String strVal = new String(content, StandardCharsets.UTF_8);
changes.putIfAbsent(localPath, Change.ofTextUpsert(localPath, strVal));
Expand Down

0 comments on commit e5a5ccb

Please sign in to comment.