mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-05 04:55:50 +01:00
Fix hg fileview resolves for same path on file and directory (#1746)
If a file and a directory with the same name existed somewhere at the same level in a Mercurial repository, our logic in the fileview command failed to collect them. The parent of the file was mistaken for the entire file path, resulting in confusing errors that the file could not be found in the manifest. With this fix, file detection should now be more secure than before. Co-authored-by: Sebastian Sdorra <sebastian.sdorra@cloudogu.com>
This commit is contained in:
@@ -26,7 +26,7 @@ import { useTranslation } from "react-i18next";
|
||||
import { useHistory, useLocation, useParams } from "react-router-dom";
|
||||
import { useSources } from "@scm-manager/ui-api";
|
||||
import { Branch, Repository } from "@scm-manager/ui-types";
|
||||
import { Breadcrumb, Loading, Notification } from "@scm-manager/ui-components";
|
||||
import { Breadcrumb, ErrorNotification, Loading, Notification } from "@scm-manager/ui-components";
|
||||
import FileTree from "../components/FileTree";
|
||||
import Content from "./Content";
|
||||
import CodeActionBar from "../../codeSection/components/CodeActionBar";
|
||||
@@ -80,6 +80,10 @@ const Sources: FC<Props> = ({ repository, branches, selectedBranch, baseUrl }) =
|
||||
enabled: !branches || !!selectedBranch,
|
||||
});
|
||||
|
||||
if (error) {
|
||||
return <ErrorNotification error={error} />;
|
||||
}
|
||||
|
||||
if (isLoading || (!error && !file)) {
|
||||
return <Loading />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user