diff options
-rwxr-xr-x | script/release.py | 11 | ||||
-rw-r--r-- | src/futils.c | 6 | ||||
-rw-r--r-- | src/futils.h | 6 | ||||
-rw-r--r-- | tests/merge/trees/renames.c | 2 |
4 files changed, 18 insertions, 7 deletions
diff --git a/script/release.py b/script/release.py index e0f29538e..3d8e9b806 100755 --- a/script/release.py +++ b/script/release.py @@ -56,6 +56,17 @@ def verify_version(version): if v[0] != v[1]: raise Error("version.h: define '{}' does not match (got '{}', expected '{}')".format(k, v[0], v[1])) + with open('package.json') as f: + pkg = json.load(f) + + try: + pkg_version = Version(pkg["version"]) + except KeyError as err: + raise Error("package.json: missing the field {}".format(err)) + + if pkg_version != version: + raise Error("package.json: version does not match (got '{}', expected '{}')".format(pkg_version, version)) + def generate_relnotes(tree, version): with open('docs/changelog.md') as f: lines = f.readlines() diff --git a/src/futils.c b/src/futils.c index a7c360a1c..8c0f008b3 100644 --- a/src/futils.c +++ b/src/futils.c @@ -834,12 +834,12 @@ int git_futils_rmdir_r( return error; } -int git_futils_fake_symlink(const char *old, const char *new) +int git_futils_fake_symlink(const char *target, const char *path) { int retcode = GIT_ERROR; - int fd = git_futils_creat_withpath(new, 0755, 0644); + int fd = git_futils_creat_withpath(path, 0755, 0644); if (fd >= 0) { - retcode = p_write(fd, old, strlen(old)); + retcode = p_write(fd, target, strlen(target)); p_close(fd); } return retcode; diff --git a/src/futils.h b/src/futils.h index 3d5664679..4668d7b63 100644 --- a/src/futils.h +++ b/src/futils.h @@ -316,11 +316,11 @@ extern void git_futils_mmap_free(git_map *map); /** * Create a "fake" symlink (text file containing the target path). * - * @param new symlink file to be created - * @param old original symlink target + * @param target original symlink target + * @param path symlink file to be created * @return 0 on success, -1 on error */ -extern int git_futils_fake_symlink(const char *new, const char *old); +extern int git_futils_fake_symlink(const char *target, const char *path); /** * A file stamp represents a snapshot of information about a file that can diff --git a/tests/merge/trees/renames.c b/tests/merge/trees/renames.c index c515aaf1b..eef7bc96b 100644 --- a/tests/merge/trees/renames.c +++ b/tests/merge/trees/renames.c @@ -307,7 +307,7 @@ void test_merge_trees_renames__cache_recomputation(void) */ cl_git_pass(git_treebuilder_new(&builder, repo, NULL)); for (i = 0; i < 1000; i++) { - cl_git_pass(git_buf_printf(&path, "%"PRIuMAX".txt", i)); + cl_git_pass(git_buf_printf(&path, "%"PRIuZ".txt", i)); cl_git_pass(git_treebuilder_insert(NULL, builder, path.ptr, &blob, GIT_FILEMODE_BLOB)); git_buf_clear(&path); } |