Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions modules/bit/cmd/bit/add.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -395,15 +395,15 @@ fn add_apply_intent_to_add(
fs,
git_dir,
@bitcore.ObjectType::Blob,
Bytes::default(),
Default::default(),
algo~,
)
@bitlib.compat_record_blob_mapping(
fs,
rfs,
git_dir,
created,
Bytes::default(),
Default::default(),
)
empty_id = Some(created)
created
Expand Down
2 changes: 1 addition & 1 deletion modules/bit/cmd/bit/blame.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ fn blame_read_path_diff_driver(
}
let text = decode_bytes(
fs.read_file(attr_path) catch {
_ => Bytes::default()
_ => Default::default()
},
)
let mut diff_driver : String? = None
Expand Down
2 changes: 1 addition & 1 deletion modules/bit/cmd/bit/cat_file.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -2824,7 +2824,7 @@ fn cat_file_read_path_attrs(
if fs.is_file(attr_path) {
let text = decode_bytes(
fs.read_file(attr_path) catch {
_ => Bytes::default()
_ => Default::default()
},
)
for line_view in text.split("\n") {
Expand Down
4 changes: 2 additions & 2 deletions modules/bit/cmd/bit/check_attr.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ fn check_attr_load_rules(
if fs.is_file(root_attr) {
let content = decode_bytes(
fs.read_file(root_attr) catch {
_ => Bytes::default()
_ => Default::default()
},
)
check_attr_parse_rules(content, rules)
Expand All @@ -134,7 +134,7 @@ fn check_attr_load_rules(
if fs.is_file(info_attr) {
let content = decode_bytes(
fs.read_file(info_attr) catch {
_ => Bytes::default()
_ => Default::default()
},
)
check_attr_parse_rules(content, rules)
Expand Down
2 changes: 1 addition & 1 deletion modules/bit/cmd/bit/check_ignore.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ fn check_ignore_add_rules_file(
if fs.is_file(file_path) {
let content = decode_bytes(
fs.read_file(file_path) catch {
_ => Bytes::default()
_ => Default::default()
},
)
matcher.add_rules(base, content)
Expand Down
2 changes: 1 addition & 1 deletion modules/bit/cmd/bit/checkout_wbtest.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ async fn checkout_wbtest_case_force_checkout_clears_merge_state() -> Unit raise
@test.assert_eq(
decode_bytes(
fs.read_file(repo_dir + "/file") catch {
_ => Bytes::default()
_ => Default::default()
},
),
"side\n",
Expand Down
2 changes: 1 addition & 1 deletion modules/bit/cmd/bit/diff.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ fn diff_conflict_marker_size(
return 7
}
let content = @utf8.decode_lossy(
(fs.read_file(attr_path) catch { _ => Bytes::default() })[:],
(fs.read_file(attr_path) catch { _ => Default::default() })[:],
)
let mut size = 7
for line_view in content.split("\n") {
Expand Down
24 changes: 12 additions & 12 deletions modules/bit/cmd/bit/handlers_remote_pull_wbtest.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -449,13 +449,13 @@ async test "pull: branch remote dot pulls from current repo config" {
handlers_remote_pull_wbtest_run_shim_git(root, ["pull", "-q"])

@test.assert_eq(
decode_bytes(fs.read_file(root + "/file") catch { _ => Bytes::default() }),
decode_bytes(fs.read_file(root + "/file") catch { _ => Default::default() }),
"updated\n",
)
assert_true(
decode_bytes(
fs.read_file(root + "/.git/logs/HEAD") catch {
_ => Bytes::default()
_ => Default::default()
},
).contains("Fast-forward"),
)
Expand Down Expand Up @@ -490,7 +490,7 @@ async test "pull: command path pulls into unborn branch from parent repo" {
@test.assert_eq(
decode_bytes(
fs.read_file(dst_dir + "/file") catch {
_ => Bytes::default()
_ => Default::default()
},
),
"file\n",
Expand Down Expand Up @@ -527,7 +527,7 @@ async test "pull: command path keeps staged new file on unborn branch" {
@test.assert_eq(
decode_bytes(
fs.read_file(dst_dir + "/newfile") catch {
_ => Bytes::default()
_ => Default::default()
},
),
"new tracked file\n",
Expand Down Expand Up @@ -619,7 +619,7 @@ async test "pull: rebase rejects staged changes on unborn branch" {
@test.assert_eq(
decode_bytes(
fs.read_file(dst_dir + "/staged-file") catch {
_ => Bytes::default()
_ => Default::default()
},
),
"staged-file\n",
Expand Down Expand Up @@ -669,11 +669,11 @@ async test "pull: rebase uses previous target as fork point for rebased upstream
])

@test.assert_eq(
decode_bytes(fs.read_file(root + "/file") catch { _ => Bytes::default() }),
decode_bytes(fs.read_file(root + "/file") catch { _ => Default::default() }),
"conflicting modification\n",
)
@test.assert_eq(
decode_bytes(fs.read_file(root + "/file2") catch { _ => Bytes::default() }),
decode_bytes(fs.read_file(root + "/file2") catch { _ => Default::default() }),
"new\n",
)
@test.assert_eq(@bitlib.read_unmerged_paths(fs, root + "/.git").length(), 0)
Expand Down Expand Up @@ -711,7 +711,7 @@ async test "pull: updates checked-out branch worktree when fetch advances it" {
])

@test.assert_eq(
decode_bytes(fs.read_file(root + "/file") catch { _ => Bytes::default() }),
decode_bytes(fs.read_file(root + "/file") catch { _ => Default::default() }),
"modified\n",
)
@test.assert_eq(
Expand All @@ -721,7 +721,7 @@ async test "pull: updates checked-out branch worktree when fetch advances it" {
assert_true(
decode_bytes(
fs.read_file(root + "/.git/logs/HEAD") catch {
_ => Bytes::default()
_ => Default::default()
},
).contains("Fast-forward"),
)
Expand Down Expand Up @@ -762,7 +762,7 @@ async test "pull: refuses dirty worktree when fetch advances current branch" {
assert_true(code != 0)
assert_true(stderr.contains("Cannot fast-forward your working tree"))
@test.assert_eq(
decode_bytes(fs.read_file(root + "/file") catch { _ => Bytes::default() }),
decode_bytes(fs.read_file(root + "/file") catch { _ => Default::default() }),
"conflict\n",
)
@test.assert_eq(
Expand Down Expand Up @@ -835,13 +835,13 @@ async test "pull: rebase autostash preserves staged file on fast-forward" {
@test.assert_eq(
decode_bytes(
fs.read_file(root + "/new_file") catch {
_ => Bytes::default()
_ => Default::default()
},
),
"dirty\n",
)
@test.assert_eq(
decode_bytes(fs.read_file(root + "/file") catch { _ => Bytes::default() }),
decode_bytes(fs.read_file(root + "/file") catch { _ => Default::default() }),
"modified again\n",
)
@test.assert_eq(@bitlib.stash_list(fs, root + "/.git").length(), 0)
Expand Down
2 changes: 1 addition & 1 deletion modules/bit/cmd/bit/helpers_shared.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

///|
fn io_error(err : @fs.IOError) -> @bitcore.GitError {
@bitcore.GitError::IoError(@debug.render(@debug.to_repr(err)))
@bitcore.GitError::IoError(@debug.render(Repr(err)))
}

///|
Expand Down
6 changes: 3 additions & 3 deletions modules/bit/cmd/bit/http_fetch.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ async fn handle_http_fetch(args : Array[String]) -> Unit raise Error {
@fs.write_bytes_to_file(pack_path, pack_data) catch {
err => {
eprint_line(
"error: cannot write \{pack_path}: \{@debug.render(@debug.to_repr(err))}",
"error: cannot write \{pack_path}: \{@debug.render(Repr(err))}",
)
continue
}
Expand Down Expand Up @@ -136,7 +136,7 @@ async fn http_fetch_loose_object(
@fs.write_bytes_to_file(path, data) catch {
err => {
eprint_line(
"error: cannot write \{path}: \{@debug.render(@debug.to_repr(err))}",
"error: cannot write \{path}: \{@debug.render(Repr(err))}",
)
@sys.exit(1)
return
Expand All @@ -162,7 +162,7 @@ fn http_fetch_write_ref(
@fs.write_bytes_to_file(ref_path, content_bytes) catch {
err =>
raise @bitcore.GitError::IoError(
"cannot write ref \{ref_path}: \{@debug.render(@debug.to_repr(err))}",
"cannot write ref \{ref_path}: \{@debug.render(Repr(err))}",
)
}
}
2 changes: 1 addition & 1 deletion modules/bit/cmd/bit/hub_github_sync.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ async fn handle_hub_issue_sync_install_hook(
if fs.is_file(hook_path) {
let existing = decode_bytes(
fs.read_file(hook_path) catch {
_ => Bytes::default()
_ => Default::default()
},
)
if existing.contains("bit issue sync") {
Expand Down
4 changes: 2 additions & 2 deletions modules/bit/cmd/bit/hub_stores.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ fn load_hub_origin_sync_plan(fs : OsFs, git_dir : String) -> HubOriginSyncPlan {
let config_path = hub_sync_config_path(git_dir)
let content = decode_bytes(
fs.read_file(config_path) catch {
_ => Bytes::default()
_ => Default::default()
},
)
compute_hub_origin_sync_plan(content)
Expand Down Expand Up @@ -405,7 +405,7 @@ fn resolve_hub_git_dir(root : String) -> String {
let commondir_path = git_dir + "/commondir"
if fs.is_file(commondir_path) {
let raw = @utf8.decode_lossy(
(fs.read_file(commondir_path) catch { _ => Bytes::default() })[:],
(fs.read_file(commondir_path) catch { _ => Default::default() })[:],
)
let rel = raw.trim(chars=" \t\r\n").to_owned()
if rel.length() > 0 {
Expand Down
22 changes: 11 additions & 11 deletions modules/bit/cmd/bit/index_pack.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -794,17 +794,17 @@ async fn handle_index_pack(args : Array[String]) -> Unit raise Error {
err if @async.is_cancellation_error(err) => raise err
err => {
@stdio.stderr.write(
"fatal: " + @debug.render(@debug.to_repr(err)) + "\n",
"fatal: " + @debug.render(Repr(err)) + "\n",
)
@sys.exit(1)
Bytes::default()
Default::default()
}
}
let max_depth = @pack.max_delta_chain_length(pack) catch {
err if @async.is_cancellation_error(err) => raise err
err => {
@stdio.stderr.write(
"fatal: " + @debug.render(@debug.to_repr(err)) + "\n",
"fatal: " + @debug.render(Repr(err)) + "\n",
)
@sys.exit(1)
0
Expand All @@ -828,10 +828,10 @@ async fn handle_index_pack(args : Array[String]) -> Unit raise Error {
err if @async.is_cancellation_error(err) => raise err
err => {
@stdio.stderr.write(
"fatal: " + @debug.render(@debug.to_repr(err)) + "\n",
"fatal: " + @debug.render(Repr(err)) + "\n",
)
@sys.exit(1)
Bytes::default()
Default::default()
}
}
let idx_path = if pack_path.has_suffix(".pack") {
Expand All @@ -844,10 +844,10 @@ async fn handle_index_pack(args : Array[String]) -> Unit raise Error {
err if @async.is_cancellation_error(err) => raise err
err => {
@stdio.stderr.write(
"fatal: " + @debug.render(@debug.to_repr(err)) + "\n",
"fatal: " + @debug.render(Repr(err)) + "\n",
)
@sys.exit(1)
Bytes::default()
Default::default()
}
}
match verify_pack_index(idx, pack, hash_size~) {
Expand All @@ -869,11 +869,11 @@ async fn handle_index_pack(args : Array[String]) -> Unit raise Error {
err => {
@stdio.stderr.write(
"error: could not read reverse index: " +
@debug.render(@debug.to_repr(err)) +
@debug.render(Repr(err)) +
"\n",
)
@sys.exit(1)
Bytes::default()
Default::default()
}
}
match verify_reverse_index(rev, pack, hash_size~) {
Expand Down Expand Up @@ -1094,10 +1094,10 @@ async fn handle_index_pack(args : Array[String]) -> Unit raise Error {
err if @async.is_cancellation_error(err) => raise err
err => {
@stdio.stderr.write(
"fatal: " + @debug.render(@debug.to_repr(err)) + "\n",
"fatal: " + @debug.render(Repr(err)) + "\n",
)
@sys.exit(1)
Bytes::default()
Default::default()
}
}
// Check --max-input-size for file mode
Expand Down
4 changes: 2 additions & 2 deletions modules/bit/cmd/bit/log.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -1393,7 +1393,7 @@ fn log_extract_commit_message_and_encoding(data : Bytes) -> (Bytes, String?) {
break
}
}
(Bytes::default(), encoding)
(Default::default(), encoding)
}

///|
Expand Down Expand Up @@ -2014,7 +2014,7 @@ fn log_resolve_common_git_dir(
return git_dir
}
let raw = @utf8.decode_lossy(
(rfs.read_file(commondir_path) catch { _ => Bytes::default() })[:],
(rfs.read_file(commondir_path) catch { _ => Default::default() })[:],
)
let rel = trim_string(raw)
if rel.length() == 0 {
Expand Down
4 changes: 2 additions & 2 deletions modules/bit/cmd/bit/ls_files.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ async fn handle_ls_files(args : Array[String]) -> Unit raise Error {
}
// Detect worktree EOL from file on disk
let w_eol = if file_exists {
let content = fs.read_file(abs) catch { _ => Bytes::default() }
let content = fs.read_file(abs) catch { _ => Default::default() }
detect_eol_type(content)
} else {
""
Expand Down Expand Up @@ -203,7 +203,7 @@ async fn handle_ls_files(args : Array[String]) -> Unit raise Error {
}
let abs = root + "/" + path
let w_eol = if fs.is_file(abs) {
let content = fs.read_file(abs) catch { _ => Bytes::default() }
let content = fs.read_file(abs) catch { _ => Default::default() }
detect_eol_type(content)
} else {
""
Expand Down
4 changes: 2 additions & 2 deletions modules/bit/cmd/bit/mailsplit.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ async fn handle_mailsplit(args : Array[String]) -> Unit raise Error {
let data = @fs.read_file_to_bytes(path) catch {
err => {
eprint_line(
"fatal: cannot open \{path}: \{@debug.render(@debug.to_repr(err))}",
"fatal: cannot open \{path}: \{@debug.render(Repr(err))}",
)
@sys.exit(1)
return
Expand Down Expand Up @@ -98,7 +98,7 @@ async fn handle_mailsplit(args : Array[String]) -> Unit raise Error {
@fs.write_string_to_file(path, content) catch {
err => {
eprint_line(
"fatal: cannot write \{path}: \{@debug.render(@debug.to_repr(err))}",
"fatal: cannot write \{path}: \{@debug.render(Repr(err))}",
)
@sys.exit(1)
return
Expand Down
2 changes: 1 addition & 1 deletion modules/bit/cmd/bit/merge_file.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ async fn handle_merge_file(args : Array[String]) -> Unit raise Error {
@fs.write_string_to_file(current_arg, result.content) catch {
e => {
eprint_line(
"fatal: could not write '\{current_arg}': \{@debug.render(@debug.to_repr(e))}",
"fatal: could not write '\{current_arg}': \{@debug.render(Repr(e))}",
)
@sys.exit(128)
}
Expand Down
2 changes: 1 addition & 1 deletion modules/bit/cmd/bit/merge_one_file.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ async fn handle_merge_one_file(args : Array[String]) -> Unit raise Error {
@fs.write_bytes_to_file(full_path, content_bytes) catch {
err => {
eprint_line(
"error: cannot write \{full_path}: \{@debug.render(@debug.to_repr(err))}",
"error: cannot write \{full_path}: \{@debug.render(Repr(err))}",
)
@sys.exit(1)
return
Expand Down
Loading
Loading