Skip to content

Commit

Permalink
(For CI -- test that the parent PR works)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyagr committed Jul 31, 2024
3 parents ce29824 + 9a6e5d4 + 161f43e commit aea01e0
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 9 deletions.
15 changes: 11 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ dunce = "1.0.4"
either = "1.13.0"
esl01-renderdag = "0.3.0"
futures = "0.3.30"
git2 = { version = "0.18.3", features = [
git2 = { version = "0.19.0", features = [
# Do *not* disable this feature even if you'd like dynamic linking. Instead,
# set the environment variable `LIBGIT2_NO_VENDOR=1` if dynamic linking must
# be used (this will override the Cargo feature), and allow static linking
Expand Down
1 change: 1 addition & 0 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ jj-lib = { workspace = true }
maplit = { workspace = true }
minus = { workspace = true }
once_cell = { workspace = true }
path-slash = "0.2.1"
pest = { workspace = true }
pest_derive = { workspace = true }
pollster = { workspace = true }
Expand Down
9 changes: 6 additions & 3 deletions cli/src/commands/git/clone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use jj_lib::git::{self, GitFetchError, GitFetchStats};
use jj_lib::repo::Repo;
use jj_lib::str_util::StringPattern;
use jj_lib::workspace::Workspace;
use path_slash::PathBufExt;

use crate::cli_util::{CommandHelper, WorkspaceCommandHelper};
use crate::command_error::{cli_error, user_error, user_error_with_message, CommandError};
Expand Down Expand Up @@ -55,10 +56,12 @@ fn absolute_git_source(cwd: &Path, source: &str) -> String {
// drive letter.
if !source.contains(':') && Path::new(source).exists() {
// It's less likely that cwd isn't utf-8, so just fall back to original source.
// TODO: This won't work for Windows UNC path or (less importantly) if the
// original source is a non-UTF Windows path. For Windows UNC paths, we
// could use dunce, though see also https://gitlab.com/kornelski/dunce/-/issues/7
cwd.join(source)
.into_os_string()
.into_string()
.unwrap_or_else(|_| source.to_owned())
.to_slash()
.map_or_else(|| source.to_owned(), |s| s.to_string())
} else {
source.to_owned()
}
Expand Down
2 changes: 2 additions & 0 deletions cli/tests/test_git_push.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1235,6 +1235,8 @@ fn test_git_push_moved_sideways_untracked() {
}

#[test]
// TODO: This test fails with libgit2 v1.8.1 on Windows.
#[cfg(not(target_os = "windows"))]
fn test_git_push_to_remote_named_git() {
let (test_env, workspace_root) = set_up();
let git_repo = {
Expand Down
7 changes: 6 additions & 1 deletion lib/src/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1265,7 +1265,12 @@ pub fn fetch(
tracing::debug!("remote.prune");
remote.prune(None)?;
tracing::debug!("remote.update_tips");
remote.update_tips(None, false, git2::AutotagOption::Unspecified, None)?;
remote.update_tips(
None,
git2::RemoteUpdateFlags::empty(),
git2::AutotagOption::Unspecified,
None,
)?;
// TODO: We could make it optional to get the default branch since we only care
// about it on clone.
let mut default_branch = None;
Expand Down

0 comments on commit aea01e0

Please sign in to comment.