Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cache.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::*;
use std::collections::HashMap;

const VERSION: u64 = 9;
const VERSION: u64 = 10;

lazy_static! {
static ref DB: std::sync::Mutex<Option<sled::Db>> = std::sync::Mutex::new(None);
Expand Down
2 changes: 1 addition & 1 deletion src/filter/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ pub fn overlay(
result_tree = replace_child(
repo,
std::path::Path::new(entry.name().ok_or(super::josh_error("no name"))?),
overlay(repo, entry.id(), e.id())?,
overlay(repo, e.id(), entry.id())?,
e.filemode(),
&result_tree,
)?;
Expand Down
92 changes: 92 additions & 0 deletions tests/filter/reverse_hide_edit_missing_change.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
$ export TESTTMP=${PWD}

$ cd ${TESTTMP}
$ git init real_repo 1> /dev/null
$ cd real_repo

$ mkdir sub2
$ mkdir subx
$ echo contentsroot > rootfile
$ echo contents1 > sub2/file1
$ echo contentsx > subx/filex
$ git add .
$ git commit -m "add file1" 1> /dev/null

$ echo contents2 > sub2/file2
$ git add .
$ git commit -m "add file2" 1> /dev/null

$ tree
.
|-- rootfile
|-- sub2
| |-- file1
| `-- file2
`-- subx
`-- filex

2 directories, 4 files

$ josh-filter -s :exclude[::sub2/] master --update refs/heads/hidden
[1] :exclude[::sub2/]
[2] :/sub2
[2] :prefix=sub2
$ git checkout hidden 1> /dev/null
Switched to branch 'hidden'
$ tree
.
|-- rootfile
`-- subx
`-- filex

1 directory, 2 files
$ git log --graph --pretty=%s
* add file1

$ echo new_root > rootfile
$ echo new_x >> subx/filex
$ git add .
$ git commit -m "edit files" 1> /dev/null

$ josh-filter -s :exclude[::sub2/] --reverse master --update refs/heads/hidden
[1] :exclude[::sub2/]
[2] :/sub2
[2] :prefix=sub2

$ git checkout master
Switched to branch 'master'

$ git log -1
commit 55031991a5c2f493f2d62201828d8f20844ab219
Author: Josh <josh@example.com>
Date: Thu Apr 7 22:13:13 2005 +0000

edit files

$ git diff HEAD~1
diff --git a/rootfile b/rootfile
index b58e324..a49be3e 100644
--- a/rootfile
+++ b/rootfile
@@ -1 +1 @@
-contentsroot
+new_root
diff --git a/subx/filex b/subx/filex
index d1cc012..4e41ce2 100644
--- a/subx/filex
+++ b/subx/filex
@@ -1 +1,2 @@
contentsx
+new_x

$ tree
.
|-- rootfile
|-- sub2
| |-- file1
| `-- file2
`-- subx
`-- filex

2 directories, 4 files