Fetch receiving 0 bytes
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
まず、表示されている remote.fetch 呼び出しを、リポジトリの fetch および pull のコード例と比較します。次に、報告された remote.stats の値と、remote-tracking 参照が変更されるかどうかを確認します。取得されたリモートコミットがローカルリポジトリに現れ、その後の fast-forward が空の結果ではなくそれらを使用すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
I'm attempting to implement pull from a remote repo, based on the fetch and pull code examples in the repo. The relevant chunk of code is as follows:
match Repository::open(&repo_path_string) {
Ok(repo) => {
let remote_name = "origin";
let remote_branch = "master";
let mut remote = repo
.find_remote(remote_name)
.expect("could not find remote");
let mut fo = git2::FetchOptions::new();
fo.download_tags(git2::AutotagOption::All);
match remote.fetch(&[remote_branch], Some(&mut fo), None) {
Ok(_) => {
let stats = remote.stats();
if stats.local_objects() > 0 {
println!(
"\rReceived {}/{} objects in {} bytes (used {} local \
objects)",
stats.indexed_objects(),
stats.total_objects(),
stats.received_bytes(),
stats.local_objects()
);
} else {
println!(
"\rReceived {}/{} objects in {} bytes",
stats.indexed_objects(),
stats.total_objects(),
stats.received_bytes()
);
}
}
Err(e) => {
return not_ok_json_response(
Status::InternalServerError,
make_bad_json_data_response(
format!("could not fetch repo: {}", e).to_string(),
),
)
}
};
...
This code compiles and runs but the remote commits do not appear in the local repo (master or remotes/origin/master - there's a subsequent fast-forward merge which succeeds but is presumably chewing on nothing).
On the console I see
Received 4/4 objects in 0 bytes (used 2 local objects)
The 0 bytes seems suspicious. git pull retrieves the commits as expected.
What am I missing?
- 主要言語
- Rust
- スター
- 2.1k
- フォーク
- 470
- 平均マージ
- 2日 17時間
- マージ済み PR(30日)
- 18
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rust-lang/git2-rs のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
`stash_foreach` crashes on stash entries with no message or a non-UTF-8 message対応中かも @shivampwm2020 が 43 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 64/100
メンテナーはふだん 1 日以内に返信
rust-lang/git2-rs の issue をすべて見る
似ている issue
-
bug P2
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
Windows microphone listing treats words in a device name as DirectShow labels対応中かも @Sujal-chaudhary が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
clipy-recorder/clipy#447 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
nightly-cleanup
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
max-sixty/worktrunk#4939 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[Flaky Test] tests::signer::v0::miner_recovers_when_broadcast_block_delay_across_tenures_occursオープンflaky
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
stacks-network/stacks-core#7918 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信