Commit d23ace9754f9a3cb832708f7cdf5eb08a7f4573a

Stefan Sperling 2019-07-25T11:21:39

fix abspath/relpath mismatch in rebase_check_path_prefix()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/got/got.c b/got/got.c
index 10849ff..2057dbe 100644
--- a/got/got.c
+++ b/got/got.c
@@ -3687,7 +3687,9 @@ rebase_check_path_prefix(struct got_object_id *parent_id,
 		goto done;
 
 	cpp_arg.path_prefix = path_prefix;
-	cpp_arg.len = strlen(path_prefix);
+	while (cpp_arg.path_prefix[0] == '/')
+		cpp_arg.path_prefix++;
+	cpp_arg.len = strlen(cpp_arg.path_prefix);
 	err = got_diff_tree(tree1, tree2, "", "", repo, check_path_prefix,
 	    &cpp_arg);
 done: