File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 1
1
# Unreleased
2
2
3
+ * Correctly find git repos in parent dirs of CWD
4
+
3
5
# Version 0.2.4
4
6
5
7
* Retarget multiple branches pointing at the same commit, eg:
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ pub struct Config {
33
33
}
34
34
35
35
pub fn instafix ( c : Config ) -> Result < ( ) , anyhow:: Error > {
36
- let repo = Repository :: open ( "." ) . context ( "opening repo" ) ?;
36
+ let repo = Repository :: open_from_env ( ) . context ( "opening repo" ) ?;
37
37
let diff = create_diff ( & repo, & c. theme , c. require_newline ) . context ( "creating diff" ) ?;
38
38
let head = repo. head ( ) . context ( "finding head commit" ) ?;
39
39
let head_branch = Branch :: wrap ( head) ;
@@ -52,7 +52,7 @@ pub fn instafix(c: Config) -> Result<(), anyhow::Error> {
52
52
let needs_stash = worktree_is_dirty ( & repo) ?;
53
53
if needs_stash {
54
54
// TODO: is it reasonable to create a new repo to work around lifetime issues?
55
- let mut repo = Repository :: open ( "." ) ?;
55
+ let mut repo = Repository :: open_from_env ( ) ?;
56
56
let sig = repo. signature ( ) ?. clone ( ) ;
57
57
repo. stash_save ( & sig, "git-instafix stashing changes" , None ) ?;
58
58
}
You can’t perform that action at this time.
0 commit comments