Giter Site home page Giter Site logo

Comments (4)

DeeUnderscore avatar DeeUnderscore commented on July 22, 2024 1

It seems to be an issue with git2. A minimal example that reproduces this is:

use git2::{Repository, IndexAddOption};

fn main() {
    let repo = Repository::open("./").unwrap();
    let mut index = repo.index().unwrap();
    index.add_all(["*"].iter(), IndexAddOption::DEFAULT, None).unwrap();
}

I'm not sure if the git2/libgit2 behavior here is a bug. Git itself when asked to git add -A in this situation adds the repository as a subproject link and prints a hint about adding it as a submodule instead.

from dura.

dswij avatar dswij commented on July 22, 2024 1

This is a git2-rs behaviour which returns Result::Err when adding another git repo inside a subdirectory.

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { code: -1, klass: 10, message: "invalid path: 'foo-git/'" }', src/main.rs:6:64
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Not sure if the preferred behaviour for dura would be ignoring these paths or adding them into consideration for checking the diff. Personally, I'd probably ask dura to watch the repos in subdirectory separately.

from dura.

tkellogg avatar tkellogg commented on July 22, 2024

Thanks for reporting. I don't have much time to look at it this weekend, but I might next week. I'm not quite sure what's going on.

from dura.

JakeStanger avatar JakeStanger commented on July 22, 2024

The ideal scenario I guess would be a include_sub_repos setting (or something to that effect) so you can toggle it. I think that should default to false.

I'd probably ask dura to watch the repos in subdirectory separately

Do you think using the existing include option would be a good way of doing this, or would that risk confusion? Would it be safer to just stick to adding an entire new repo entry in the config?

from dura.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.