Commit 123560764855067174ed48b652a49737a674f423

Jacques Germishuys 2018-03-02T12:41:04

worktree: lock reason should be const

diff --git a/include/git2/worktree.h b/include/git2/worktree.h
index d3fa88e..a2a5d44 100644
--- a/include/git2/worktree.h
+++ b/include/git2/worktree.h
@@ -123,7 +123,7 @@ GIT_EXTERN(int) git_worktree_add(git_worktree **out, git_repository *repo,
  * @param reason Reason why the working tree is being locked
  * @return 0 on success, non-zero otherwise
  */
-GIT_EXTERN(int) git_worktree_lock(git_worktree *wt, char *reason);
+GIT_EXTERN(int) git_worktree_lock(git_worktree *wt, const char *reason);
 
 /**
  * Unlock a locked worktree
diff --git a/src/worktree.c b/src/worktree.c
index 5a814a2..d1e4efb 100644
--- a/src/worktree.c
+++ b/src/worktree.c
@@ -383,7 +383,7 @@ out:
 	return err;
 }
 
-int git_worktree_lock(git_worktree *wt, char *creason)
+int git_worktree_lock(git_worktree *wt, const char *creason)
 {
 	git_buf buf = GIT_BUF_INIT, path = GIT_BUF_INIT;
 	int err;