diff --git a/.travis.yml b/.travis.yml index 876d820..e06cec6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,11 @@ language: rust dist: xenial +osx_image: xcode10.2 + cache: - cargo - directories: - "${HOME}/kcov/" - -os: - - linux - addons: apt: packages: @@ -21,6 +19,9 @@ addons: - binutils-dev sources: - kalakris-cmake + homebrew: + packages: + - cmake matrix: fast_finish: true @@ -36,15 +37,15 @@ matrix: - os: linux rust: stable env: TARGET=x86_64-unknown-linux-musl - # - os: osx - # rust: nightly - # env: TARGET=x86_64-apple-darwin - # - os: osx - # rust: beta - # env: TARGET=x86_64-apple-darwin - # - os: osx - # rust: stable - # env: TARGET=x86_64-apple-darwin + - os: osx + rust: nightly + env: TARGET=x86_64-apple-darwin + - os: osx + rust: beta + env: TARGET=x86_64-apple-darwin + - os: osx + rust: stable + env: TARGET=x86_64-apple-darwin before_script: - rustup target add $TARGET @@ -65,9 +66,8 @@ script: - cp target/$TARGET/release/gitkv target/$TARGET/release/gitkv-$TARGET && chmod +x target/$TARGET/release/gitkv-$TARGET after_success: - # Generates repo test coverage and pushes it codecov - - cargo coverage --target $TARGET --kcov-build-location "${HOME}/kcov/" - - bash <(curl -s https://codecov.io/bash) + - test $TRAVIS_OS_NAME = "linux" && cargo coverage --target $TARGET --kcov-build-location "${HOME}/kcov/" + - test $TRAVIS_OS_NAME = "linux" && bash <(curl -s https://codecov.io/bash) deploy: # Push binaries to the GitHub release for this version. @@ -83,9 +83,10 @@ deploy: # Push Docker container to Docker Hub tagger for this version. - provider: script skip_cleanup: true - script: ./docker/build.sh $TRAVIS_BRANCH $TARGET && docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD" && docker push intenthq/gitkv:$TRAVIS_BRANCH + script: + - ./docker/build.sh $TRAVIS_BRANCH $TARGET && docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD" && docker push intenthq/gitkv:$TRAVIS_BRANCH on: + condition: $TRAVIS_OS_NAME = "linux" rust: stable - os: linux tags: true branch: /^v\d+\.\d+\.\d+.*$/ diff --git a/git/src/lib.rs b/git/src/lib.rs index 5de0d2e..3282a3d 100644 --- a/git/src/lib.rs +++ b/git/src/lib.rs @@ -62,7 +62,7 @@ mod tests { use super::{GitOps, LibGitOps}; - use git2::Repository; + use git2::{Repository, Signature, Time}; use std::fs; use std::io::Write; use std::path::Path; @@ -138,16 +138,18 @@ mod tests { index .add_path(Path::new(file)) .expect("can't add file to index"); - repo.signature().and_then(|sig| { - index - .write_tree() - .and_then(|tid| repo.find_tree(tid)) - .and_then(|tree| { - repo.commit(Some("HEAD"), &sig, &sig, "Initial commit", &tree, &[]) - }) - }) - }) - .expect("can't do first commit"); + + let time = Time::new(123_456_789, 0); + let sig = Signature::new("Foo McBarson", "foo.mcbarson@iamarealboy.net", &time) + .expect("couldn't create signature for commit"); + + index + .write_tree() + .and_then(|tid| repo.find_tree(tid)) + .and_then(|tree| { + repo.commit(Some("HEAD"), &sig, &sig, "Initial commit", &tree, &[]) + }) + }).expect("can't do first commit");; callback(&repo); dir.close().expect("couldn't close the dir");