Skip to content

Commit 13c7824

Browse files
reset URL via git remote set-url, update boost
Signed-off-by: Felix Gündling <felix.guendling@gmail.com>
1 parent 6fa6f5a commit 13c7824

File tree

5 files changed

+36
-27
lines changed

5 files changed

+36
-27
lines changed

.clang-format

+16-17
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ AlwaysBreakTemplateDeclarations: true
1313
SpacesBeforeTrailingComments: 2
1414
IncludeBlocks: Preserve
1515
IncludeCategories:
16-
- Regex: '^<.*\.h>'
17-
Priority: 1
18-
- Regex: '^<c.*'
19-
Priority: 2
20-
- Regex: '^<.*'
21-
Priority: 4
22-
- Regex: '.*'
23-
Priority: 5
16+
- Regex: '^<.*\.h>'
17+
Priority: 1
18+
- Regex: '^<c.*'
19+
Priority: 2
20+
- Regex: '^<.*'
21+
Priority: 4
22+
- Regex: '.*'
23+
Priority: 5
2424
---
2525
BasedOnStyle: Google
2626
ColumnLimit: 80
@@ -37,12 +37,11 @@ AlwaysBreakTemplateDeclarations: true
3737
SpacesBeforeTrailingComments: 2
3838
IncludeBlocks: Preserve
3939
IncludeCategories:
40-
- Regex: '^<.*\.h>'
41-
Priority: 1
42-
- Regex: '^<c.*'
43-
Priority: 2
44-
Priority: 3
45-
- Regex: '^<.*'
46-
Priority: 4
47-
- Regex: '.*'
48-
Priority: 5
40+
- Regex: '^<.*\.h>'
41+
Priority: 1
42+
- Regex: '^<c.*'
43+
Priority: 2
44+
- Regex: '^<.*'
45+
Priority: 4
46+
- Regex: '.*'
47+
Priority: 5

deps/boost

Submodule boost updated 7026 files

include/pkg/git.h

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ struct commit_info {
1818
branch_commit bc_;
1919
};
2020

21+
std::string ssh_to_https(std::string url);
22+
2123
std::string git_shorten(dep const*, std::string const& commit);
2224

2325
void git_clone(executor&, dep const*, bool clone_https);

src/load_deps.cc

+3
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ void load_deps(fs::path const& repo, fs::path const& deps_root,
4141
(d->commit_ != bc.commit_ && !commit_exists(d, bc.commit_))) {
4242
fmt::print("{}: fetch\n", d->name());
4343
std::cout << std::flush;
44+
e.exec(d->path_, "git remote set-url origin {}",
45+
clone_https ? ssh_to_https(d->url_) : d->url_);
4446
e.exec(d->path_, "git fetch origin");
4547
}
4648

@@ -141,6 +143,7 @@ void load_deps(fs::path const& repo, fs::path const& deps_root,
141143
} catch (std::exception const& e) {
142144
fmt::print("Checkout failed for {}: {}\n", d->name(), e.what());
143145
ex.print_trace();
146+
throw;
144147
}
145148
}
146149
} while (repeat);

src/main.cc

+14-9
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,19 @@ int main(int argc, char** argv) {
3030
return 0;
3131
}
3232

33-
auto const mode = std::string_view{argv[1]};
34-
set_verbose(has_flag(argc - 1, argv + 1, "-v"));
35-
if (mode == "load" || mode == "-l") {
36-
load_deps(fs::path{"."}, fs::path("deps"), //
37-
has_flag(argc - 1, argv + 1, "-h"), //
38-
has_flag(argc - 1, argv + 1, "-f"), //
39-
has_flag(argc - 1, argv + 1, "-r"));
40-
} else if (mode == "status" || mode == "-s") {
41-
print_status(fs::path{"."}, fs::path("deps"));
33+
try {
34+
auto const mode = std::string_view{argv[1]};
35+
set_verbose(has_flag(argc - 1, argv + 1, "-v"));
36+
if (mode == "load" || mode == "-l") {
37+
load_deps(fs::path{"."}, fs::path("deps"), //
38+
has_flag(argc - 1, argv + 1, "-h"), //
39+
has_flag(argc - 1, argv + 1, "-f"), //
40+
has_flag(argc - 1, argv + 1, "-r"));
41+
} else if (mode == "status" || mode == "-s") {
42+
print_status(fs::path{"."}, fs::path("deps"));
43+
}
44+
} catch (std::exception const& e) {
45+
std::cerr << "error: " << e.what() << "\n";
46+
return 1;
4247
}
4348
}

0 commit comments

Comments
 (0)