-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Git [submodules] are encoded as commits when walking a Git tree. To allow the support of them in `radicle-surf`, the tree entry is checked for this case. The entry will be treated such that it is has a name, prefix, Oid, and the submodule's URL. It's important to note that the Oid is not usable within the context of the repository that is being browsed, since they are entirely separate. Instead, the URL should be used in conjunction with the Oid for browsing purposes outside of `radicle-surf`. However, in a future iteration it may be considered to be able to browse the local contents of the submodule, if possible. [submodules]: https://git-scm.com/book/en/v2/Git-Tools-Submodules Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett
- Loading branch information
Showing
9 changed files
with
173 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "git-platinum"] | ||
path = radicle-surf/data/git-platinum | ||
url = https://github.com/radicle-dev/git-platinum.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule git-platinum
added at
27acd6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,17 @@ | ||
#[cfg(not(feature = "gh-actions"))] | ||
#[test] | ||
// An issue with submodules, see: https://github.com/radicle-dev/radicle-surf/issues/54 | ||
fn test_submodule_failure() { | ||
fn test_submodule() { | ||
use radicle_git_ext::ref_format::refname; | ||
use radicle_surf::{Branch, Repository}; | ||
use radicle_surf::{fs, Branch, Repository}; | ||
|
||
let repo = Repository::discover(".").unwrap(); | ||
repo.root_dir(Branch::local(refname!("main"))).unwrap(); | ||
let dir = repo | ||
.root_dir(Branch::local(refname!("surf/submodule-support"))) | ||
.unwrap(); | ||
let platinum = dir | ||
.find_entry( | ||
&std::path::Path::new("radicle-surf/data/git-platinum"), | ||
&repo, | ||
) | ||
.unwrap(); | ||
assert!(matches!(platinum, fs::Entry::Submodule(_))); | ||
} |