Commit Diff


commit - 4de9fa04834ddee6e2e9ee097d465a5b29921e0f
commit + fd025130ffb23d779b740391823f305518b39ee1
blob - 5e361ba7f6fa77f9358deaad245b6589b7c35e15
blob + 6652a0e142d22804174660f5bfac8d20073bdec6
--- cvg/cvg.1
+++ cvg/cvg.1
@@ -135,6 +135,7 @@ working directory.
 .Cm clone
 .Op Fl almqv
 .Op Fl b Ar branch
+.Op Fl i Ar identity-file
 .Op Fl J Ar jumphost
 .Op Fl R Ar reference
 .Ar repository-URL
@@ -241,6 +242,12 @@ repository's HEAD reference will be fetched.
 Cannot be used together with the
 .Fl a
 option.
+.It Fl i Ar identity-file
+Specify an
+.Ar identity-file ,
+containing a private SSH key, to use with SSH connections.
+The same option will be passed to
+.Xr ssh 1 .
 .It Fl J Ar jumphost
 Specify a
 .Ar jumphost
@@ -408,6 +415,7 @@ Silence progress output.
 .Op Fl q
 .Op Fl b Ar branch
 .Op Fl c Ar commit
+.Op Fl i Ar identity-file
 .Op Fl J Ar jumphost
 .Op Ar path ...
 .Xc
@@ -505,6 +513,12 @@ An abbreviated hash argument will be expanded to a com
 automatically, provided the abbreviation is unique.
 If this option is not specified, the most recent commit on the work tree's
 branch will be used.
+.It Fl i Ar identity-file
+Specify an
+.Ar identity-file ,
+containing a private SSH key, to use with SSH connections.
+The same option will be passed to
+.Xr ssh 1 .
 .It Fl J Ar jumphost
 Specify a
 .Ar jumphost
@@ -1301,6 +1315,7 @@ is a directory.
 .Op Fl CNnS
 .Op Fl A Ar author
 .Op Fl F Ar path
+.Op Fl i Ar identity-file
 .Op Fl J Ar jumphost
 .Op Fl m Ar message
 .Op Ar path ...
@@ -1411,6 +1426,12 @@ Use the specified log message when creating the new co
 Cannot be used together with the
 .Fl F
 option.
+.It Fl i Ar identity-file
+Specify an
+.Ar identity-file ,
+containing a private SSH key, to use with SSH connections.
+The same option will be passed to
+.Xr ssh 1 .
 .It Fl J Ar jumphost
 Specify a
 .Ar jumphost
blob - ae0668eca3b308ad4365af640926b2f53d3cba2d
blob + e7efb2f42607b5d2d795aaea607648b2b504eba0
--- cvg/cvg.c
+++ cvg/cvg.c
@@ -978,8 +978,9 @@ done:
 __dead static void
 usage_clone(void)
 {
-	fprintf(stderr, "usage: %s clone [-almqv] [-b branch] [-J jumphost ] "
-	    "[-R reference] repository-URL [directory]\n", getprogname());
+	fprintf(stderr, "usage: %s clone [-almqv] [-b branch] "
+	    "[-i identity-file] [-J jumphost] [-R reference] "
+	    "repository-URL [directory]\n", getprogname());
 	exit(1);
 }
 
@@ -1539,6 +1540,7 @@ cmd_clone(int argc, char *argv[])
 	int verbosity = 0, fetch_all_branches = 0, mirror_references = 0;
 	int bflag = 0, list_refs_only = 0;
 	int *pack_fds = NULL;
+	const char *identity_file = NULL;
 	const char *jumphost = NULL;
 
 	RB_INIT(&refs);
@@ -1546,7 +1548,7 @@ cmd_clone(int argc, char *argv[])
 	RB_INIT(&wanted_branches);
 	RB_INIT(&wanted_refs);
 
-	while ((ch = getopt(argc, argv, "ab:J:lmqR:v")) != -1) {
+	while ((ch = getopt(argc, argv, "ab:i:J:lmqR:v")) != -1) {
 		switch (ch) {
 		case 'a':
 			fetch_all_branches = 1;
@@ -1557,6 +1559,9 @@ cmd_clone(int argc, char *argv[])
 			if (error)
 				return error;
 			bflag = 1;
+			break;
+		case 'i':
+			identity_file = optarg;
 			break;
 		case 'J':
 			jumphost = optarg;
@@ -1679,7 +1684,7 @@ cmd_clone(int argc, char *argv[])
 		printf("Connecting to %s\n", git_url);
 
 	error = got_fetch_connect(&fetchpid, &fetchfd, proto, host, port,
-	    server_path, jumphost, verbosity);
+	    server_path, jumphost, identity_file, verbosity);
 	if (error)
 		goto done;
 
@@ -2491,8 +2496,9 @@ print_merge_progress_stats(struct got_update_progress_
 __dead static void
 usage_update(void)
 {
-	fprintf(stderr, "usage: %s update [-qtvX] [-c commit] [-J jumphost ] "
-	    "[-r remote] [path ...]\n", getprogname());
+	fprintf(stderr, "usage: %s update [-qtvX] [-c commit] "
+	    "[-i identity-file] [-J jumphost] [-r remote] [path ...]\n",
+	    getprogname());
 	exit(1);
 }
 
@@ -2671,6 +2677,7 @@ cmd_update(int argc, char *argv[])
 	char *commit_id_str = NULL;
 	const char *refname;
 	struct got_reference *head_ref = NULL;
+	const char *identity_file = NULL;
 	const char *jumphost = NULL;
 
 	RB_INIT(&paths);
@@ -2680,13 +2687,16 @@ cmd_update(int argc, char *argv[])
 	RB_INIT(&wanted_branches);
 	RB_INIT(&wanted_refs);
 
-	while ((ch = getopt(argc, argv, "c:J:qr:vX")) != -1) {
+	while ((ch = getopt(argc, argv, "c:i:J:qr:vX")) != -1) {
 		switch (ch) {
 		case 'c':
 			commit_id_str = strdup(optarg);
 			if (commit_id_str == NULL)
 				return got_error_from_errno("strdup");
 			break;
+		case 'i':
+			identity_file = optarg;
+			break;
 		case 'J':
 			jumphost = optarg;
 			break;
@@ -2841,7 +2851,7 @@ cmd_update(int argc, char *argv[])
 	}
 
 	error = got_fetch_connect(&fetchpid, &fetchfd, proto, host, port,
-	    server_path, jumphost, verbosity);
+	    server_path, jumphost, identity_file, verbosity);
 	if (error)
 		goto done;
 
@@ -7487,8 +7497,9 @@ done:
 __dead static void
 usage_commit(void)
 {
-	fprintf(stderr, "usage: %s commit [-CNnS] [-A author] [-J jumphost ] "
-	    "[-F path] [-m message] [path ...]\n", getprogname());
+	fprintf(stderr, "usage: %s commit [-CNnS] [-A author] "
+	    "[-i identity-file] [-J jumphost] [-F path] [-m message] "
+	    "[path ...]\n", getprogname());
 	exit(1);
 }
 
@@ -7811,7 +7822,7 @@ cmd_commit(int argc, char *argv[])
 	int nremotes;
 	char *proto = NULL, *host = NULL, *port = NULL;
 	char *repo_name = NULL, *server_path = NULL;
-	const char *remote_name, *jumphost = NULL;
+	const char *remote_name, *jumphost = NULL, *identity_file = NULL;
 	int verbosity = 0;
 	int i;
 
@@ -7825,7 +7836,7 @@ cmd_commit(int argc, char *argv[])
 		err(1, "pledge");
 #endif
 
-	while ((ch = getopt(argc, argv, "A:CF:J:m:NnS")) != -1) {
+	while ((ch = getopt(argc, argv, "A:CF:i:J:m:NnS")) != -1) {
 		switch (ch) {
 		case 'A':
 			author = optarg;
@@ -7844,6 +7855,9 @@ cmd_commit(int argc, char *argv[])
 				return got_error_from_errno2("realpath",
 				    optarg);
 			break;
+		case 'i':
+			identity_file = optarg;
+			break;
 		case 'J':
 			jumphost = optarg;
 			break;
@@ -8036,7 +8050,7 @@ cmd_commit(int argc, char *argv[])
 	error = got_worktree_cvg_commit(&id, worktree, &paths, author,
 	    committer, allow_bad_symlinks, show_diff, commit_conflicts,
 	    collect_commit_logmsg, &cl_arg, print_status, NULL, proto, host,
-	    port, server_path, jumphost, verbosity, remote,
+	    port, server_path, jumphost, identity_file, verbosity, remote,
 	    check_cancelled, repo);
 	if (error) {
 		if (error->code != GOT_ERR_COMMIT_MSG_EMPTY &&
blob - 96794d6aa787f704f409ac79ea9ef7d1ef02caee
blob + dbd5096b6fb2eb9f6253e0d0673a2a9e0d7aff47
--- got/got.1
+++ got/got.1
@@ -204,6 +204,7 @@ working directory.
 .Cm clone
 .Op Fl almqv
 .Op Fl b Ar branch
+.Op Fl i Ar identity-file
 .Op Fl J Ar jumphost
 .Op Fl R Ar reference
 .Ar repository-URL
@@ -339,6 +340,12 @@ repository's HEAD reference will be fetched.
 Cannot be used together with the
 .Fl a
 option.
+.It Fl i Ar identity-file
+Specify an
+.Ar identity-file ,
+containing a private SSH key, to use with SSH connections.
+The same option will be passed to
+.Xr ssh 1 .
 .It Fl J Ar jumphost
 Specify a
 .Ar jumphost
@@ -432,6 +439,7 @@ The maximum is 3.
 .Cm fetch
 .Op Fl adlqtvX
 .Op Fl b Ar branch
+.Op Fl i Ar identity-file
 .Op Fl J Ar jumphost
 .Op Fl R Ar reference
 .Op Fl r Ar repository-path
@@ -539,6 +547,12 @@ Any commit, tree, tag, and blob objects belonging to d
 tags remain in the repository and may be removed separately with
 Git's garbage collector or
 .Cm gotadmin cleanup .
+.It Fl i Ar identity-file
+Specify an
+.Ar identity-file ,
+containing a private SSH key, to use with SSH connections.
+The same option will be passed to
+.Xr ssh 1 .
 .It Fl J Ar jumphost
 Specify a
 .Ar jumphost
@@ -2351,6 +2365,7 @@ in the repository.
 .Op Fl afqTv
 .Op Fl b Ar branch
 .Op Fl d Ar branch
+.Op Fl i Ar identity-file
 .Op Fl J Ar jumphost
 .Op Fl r Ar repository-path
 .Op Fl t Ar tag
@@ -2486,6 +2501,12 @@ copy of a branch or tag is known to be out-of-date and
 disposable.
 The risks of creating inconsistencies between different repositories
 should also be taken into account.
+.It Fl i Ar identity-file
+Specify an
+.Ar identity-file ,
+containing a private SSH key, to use with SSH connections.
+The same option will be passed to
+.Xr ssh 1 .
 .It Fl J Ar jumphost
 Specify a
 .Ar jumphost
blob - b0fcf21172716b614cc7ec763f02832f62fcdc04
blob + 5965b18be7b985a3325b16f9486cfca3f4cfce65
--- got/got.c
+++ got/got.c
@@ -1074,8 +1074,9 @@ done:
 __dead static void
 usage_clone(void)
 {
-	fprintf(stderr, "usage: %s clone [-almqv] [-b branch] [-J jumphost ] "
-	    "[-R reference] " "repository-URL [directory]\n", getprogname());
+	fprintf(stderr, "usage: %s clone [-almqv] [-b branch] "
+	    "[-i identity-file] [-J jumphost] [-R reference] "
+	    "repository-URL [directory]\n", getprogname());
 	exit(1);
 }
 
@@ -1632,7 +1633,7 @@ cmd_clone(int argc, char *argv[])
 	pid_t fetchpid = -1;
 	struct got_fetch_progress_arg fpa;
 	char *git_url = NULL;
-	const char *jumphost = NULL;
+	const char *jumphost = NULL, *identity_file = NULL;
 	int verbosity = 0, fetch_all_branches = 0, mirror_references = 0;
 	int bflag = 0, list_refs_only = 0;
 	int *pack_fds = NULL;
@@ -1642,7 +1643,7 @@ cmd_clone(int argc, char *argv[])
 	RB_INIT(&wanted_branches);
 	RB_INIT(&wanted_refs);
 
-	while ((ch = getopt(argc, argv, "ab:J:lmqR:v")) != -1) {
+	while ((ch = getopt(argc, argv, "ab:i:J:lmqR:v")) != -1) {
 		switch (ch) {
 		case 'a':
 			fetch_all_branches = 1;
@@ -1653,6 +1654,9 @@ cmd_clone(int argc, char *argv[])
 			if (error)
 				return error;
 			bflag = 1;
+			break;
+		case 'i':
+			identity_file = optarg;
 			break;
 		case 'J':
 			jumphost = optarg;
@@ -1775,7 +1779,7 @@ cmd_clone(int argc, char *argv[])
 		printf("Connecting to %s\n", git_url);
 
 	error = got_fetch_connect(&fetchpid, &fetchfd, proto, host, port,
-	    server_path, jumphost, verbosity);
+	    server_path, jumphost, identity_file, verbosity);
 	if (error)
 		goto done;
 
@@ -2137,9 +2141,9 @@ done:
 __dead static void
 usage_fetch(void)
 {
-	fprintf(stderr, "usage: %s fetch [-adlqtvX] [-b branch] [-J jumphost ] "
-	    "[-R reference] [-r repository-path] [remote-repository]\n",
-	    getprogname());
+	fprintf(stderr, "usage: %s fetch [-adlqtvX] [-b branch] "
+	    "[-i identity-file] [-J jumphost] [-R reference] "
+	    "[-r repository-path] [remote-repository]\n", getprogname());
 	exit(1);
 }
 
@@ -2393,7 +2397,7 @@ cmd_fetch(int argc, char *argv[])
 	int delete_refs = 0, replace_tags = 0, delete_remote = 0;
 	int *pack_fds = NULL, have_bflag = 0;
 	const char *remote_head = NULL, *worktree_branch = NULL;
-	const char *jumphost = NULL;
+	const char *jumphost = NULL, *identity_file = NULL;
 
 	RB_INIT(&refs);
 	RB_INIT(&symrefs);
@@ -2401,7 +2405,7 @@ cmd_fetch(int argc, char *argv[])
 	RB_INIT(&wanted_branches);
 	RB_INIT(&wanted_refs);
 
-	while ((ch = getopt(argc, argv, "ab:dJ:lqR:r:tvX")) != -1) {
+	while ((ch = getopt(argc, argv, "ab:di:J:lqR:r:tvX")) != -1) {
 		switch (ch) {
 		case 'a':
 			fetch_all_branches = 1;
@@ -2415,6 +2419,9 @@ cmd_fetch(int argc, char *argv[])
 			break;
 		case 'd':
 			delete_refs = 1;
+			break;
+		case 'i':
+			identity_file = optarg;
 			break;
 		case 'J':
 			jumphost = optarg;
@@ -2656,7 +2663,7 @@ cmd_fetch(int argc, char *argv[])
 	}
 
 	error = got_fetch_connect(&fetchpid, &fetchfd, proto, host, port,
-	    server_path, jumphost, verbosity);
+	    server_path, jumphost, identity_file, verbosity);
 	if (error)
 		goto done;
 #ifndef PROFILE
@@ -9795,7 +9802,7 @@ __dead static void
 usage_send(void)
 {
 	fprintf(stderr, "usage: %s send [-afqTv] [-b branch] [-d branch] "
-	    "[-J jumphost ] [-r repository-path] [-t tag] "
+	    "[-i identity-file] [-J jumphost] [-r repository-path] [-t tag] "
 	    "[remote-repository]\n", getprogname());
 	exit(1);
 }
@@ -10023,7 +10030,7 @@ cmd_send(int argc, char *argv[])
 	int send_all_branches = 0, send_all_tags = 0;
 	struct got_reference *ref = NULL;
 	int *pack_fds = NULL;
-	const char *jumphost = NULL;
+	const char *jumphost = NULL, *identity_file = NULL;
 
 	RB_INIT(&branches);
 	RB_INIT(&tags);
@@ -10032,7 +10039,7 @@ cmd_send(int argc, char *argv[])
 	RB_INIT(&delete_args);
 	RB_INIT(&delete_branches);
 
-	while ((ch = getopt(argc, argv, "ab:d:fJ:qr:Tt:v")) != -1) {
+	while ((ch = getopt(argc, argv, "ab:d:fi:J:qr:Tt:v")) != -1) {
 		switch (ch) {
 		case 'a':
 			send_all_branches = 1;
@@ -10051,6 +10058,9 @@ cmd_send(int argc, char *argv[])
 		case 'f':
 			overwrite_refs = 1;
 			break;
+		case 'i':
+			identity_file = optarg;
+			break;
 		case 'J':
 			jumphost = optarg;
 			break;
@@ -10321,7 +10331,7 @@ cmd_send(int argc, char *argv[])
 	}
 
 	error = got_send_connect(&sendpid, &sendfd, proto, host, port,
-	    server_path, jumphost, verbosity);
+	    server_path, jumphost, identity_file, verbosity);
 	if (error)
 		goto done;
 
blob - abf138991ddab8ea1eae485f37d910d443f8fe76
blob + 4e7f538f523c582bd0b2b8be1e97182731a9ec7e
--- include/got_fetch.h
+++ include/got_fetch.h
@@ -20,6 +20,7 @@
  * Attempt to open a connection to a server using the provided protocol
  * scheme, hostname port number (as a string) and server-side path.
  * A jumphost can be specified which will be passed to ssh(1) via -J.
+ * An identity file can be specified which will be passed to ssh(1) via -i.
  * A verbosity level can be specified; it currently controls the amount
  * of -v options passed to ssh(1). If the level is -1 ssh(1) will be run
  * with the -q option.
@@ -32,7 +33,7 @@
  * the process to exit with waitpid(2). Otherwise, return PID -1.
  */
 const struct got_error *got_fetch_connect(pid_t *, int *, const char *,
-    const char *, const char *, const char *, const char *, int);
+    const char *, const char *, const char *, const char *, const char *, int);
 
 /* A callback function which gets invoked with progress information to print. */
 typedef const struct got_error *(*got_fetch_progress_cb)(void *,
blob - 9f8c6498d5a65aa365c53f33830bcb336c8c2ee3
blob + f80d4a9a8b4bfaf749a1088b2095b9c830444385
--- include/got_send.h
+++ include/got_send.h
@@ -27,13 +27,14 @@
  * If successful return an open file descriptor for the connection which can
  * be passed to other functions below, and must be disposed of with close(2).
  * A jumphost can be specified which will be passed to ssh(1) via -J.
+ * An identity file can be specified which will be passed to ssh(1) via -i.
  *
  * If an ssh(1) process was started return its PID as well, in which case
  * the caller should eventually send SIGTERM to the procress and wait for
  * the process to exit with waitpid(2). Otherwise, return PID -1.
  */
 const struct got_error *got_send_connect(pid_t *, int *, const char *,
-    const char *, const char *, const char *, const char *, int);
+    const char *, const char *, const char *, const char *, const char *, int);
 
 /* A callback function which gets invoked with progress information to print. */
 typedef const struct got_error *(*got_send_progress_cb)(void *,
blob - 72cd9b87962075687ca6d1b929f6f55cb33236ef
blob + 057137a8ccbd155e4eebbe781aa2acbab0177706
--- include/got_worktree_cvg.h
+++ include/got_worktree_cvg.h
@@ -31,8 +31,8 @@ const struct got_error *got_worktree_cvg_commit(struct
     struct got_worktree *, struct got_pathlist_head *, const char *,
     const char *, int, int, int, got_worktree_commit_msg_cb, void *,
     got_worktree_status_cb, void *, const char *, const char *, const char *,
-    const char *, const char *, int, const struct got_remote_repo *,
-    got_cancel_cb, struct got_repository *);
+    const char *, const char *, const char *, int,
+    const struct got_remote_repo *, got_cancel_cb, struct got_repository *);
 
 /*
  * Get the reference name for a temporary commit to be trivially rebased
blob - 4269fe5ff7d20951bc81bdd80614969b7fe62755
blob + e167ce4fc4fdbd3ba61f87ec9df08caaeedc1759
--- lib/dial.c
+++ lib/dial.c
@@ -264,13 +264,13 @@ escape_path(char *buf, size_t bufsize, const char *pat
 const struct got_error *
 got_dial_ssh(pid_t *newpid, int *newfd, const char *host,
     const char *port, const char *path, const char *jumphost,
-    const char *command, int verbosity)
+    const char *identity_file, const char *command, int verbosity)
 {
 	const struct got_error *error = NULL;
 	int pid, pfd[2];
 	char cmd[64];
 	char escaped_path[PATH_MAX];
-	const char *argv[13];
+	const char *argv[15];
 	int i = 0, j;
 
 	*newpid = -1;
@@ -292,6 +292,10 @@ got_dial_ssh(pid_t *newpid, int *newfd, const char *ho
 		for (j = 0; j < MIN(3, verbosity); j++)
 			argv[i++] = "-v";
 	}
+	if (identity_file) {
+		argv[i++] = "-i";
+		argv[i++] = identity_file;
+	}
 	if (jumphost) {
 		argv[i++] = "-J";
 		argv[i++] = jumphost;
blob - 1f3365fb1f7fd5cb44b644366a5274572338388a
blob + 0a728e189bd598248853f6fa3b318a1caaf2e224
--- lib/fetch.c
+++ lib/fetch.c
@@ -75,7 +75,7 @@
 const struct got_error *
 got_fetch_connect(pid_t *fetchpid, int *fetchfd, const char *proto,
     const char *host, const char *port, const char *server_path,
-    const char *jumphost, int verbosity)
+    const char *jumphost, const char *identity_file, int verbosity)
 {
 	const struct got_error *err = NULL;
 
@@ -84,7 +84,8 @@ got_fetch_connect(pid_t *fetchpid, int *fetchfd, const
 
 	if (strcmp(proto, "ssh") == 0 || strcmp(proto, "git+ssh") == 0)
 		err = got_dial_ssh(fetchpid, fetchfd, host, port,
-		    server_path, jumphost, GOT_DIAL_CMD_FETCH, verbosity);
+		    server_path, jumphost, identity_file, GOT_DIAL_CMD_FETCH,
+		    verbosity);
 	else if (strcmp(proto, "git") == 0)
 		err = got_dial_git(fetchfd, host, port, server_path,
 		    GOT_DIAL_CMD_FETCH);
blob - 2e53b80d6121b5d2e79d4ffedc74c0fb6529a6de
blob + 744dd8b9e085007b57922969f9e2db67f86e8bf6
--- lib/got_lib_dial.h
+++ lib/got_lib_dial.h
@@ -23,7 +23,8 @@ const struct got_error *got_dial_git(int *newfd, const
 
 const struct got_error *got_dial_ssh(pid_t *newpid, int *newfd,
     const char *host, const char *port, const char *path,
-    const char *jumphost, const char *command, int verbosity);
+    const char *jumphost, const char *identity_file,
+    const char *command, int verbosity);
 
 const struct got_error *got_dial_http(pid_t *newpid, int *newfd,
     const char *host, const char *port, const char *path, int, int);
blob - 95c3f4c4146cd54d646d4d9399558c8828f9665d
blob + c921af09ce0ec19b005e3d915225299721c2f81f
--- lib/send.c
+++ lib/send.c
@@ -83,7 +83,7 @@
 const struct got_error *
 got_send_connect(pid_t *sendpid, int *sendfd, const char *proto,
     const char *host, const char *port, const char *server_path,
-    const char *jumphost, int verbosity)
+    const char *jumphost, const char *identity_file, int verbosity)
 {
 	const struct got_error *err = NULL;
 
@@ -92,7 +92,7 @@ got_send_connect(pid_t *sendpid, int *sendfd, const ch
 
 	if (strcmp(proto, "ssh") == 0 || strcmp(proto, "git+ssh") == 0)
 		err = got_dial_ssh(sendpid, sendfd, host, port, server_path,
-		    jumphost, GOT_DIAL_CMD_SEND, verbosity);
+		    jumphost, identity_file, GOT_DIAL_CMD_SEND, verbosity);
 	else if (strcmp(proto, "git") == 0)
 		err = got_dial_git(sendfd, host, port, server_path,
 		    GOT_DIAL_CMD_SEND);
blob - 9978cfb50b34a2b74902fcefc506bb9770063f6a
blob + 7d213eff608b21b69d395c54e98607d6a422821c
--- lib/worktree_cvg.c
+++ lib/worktree_cvg.c
@@ -2761,9 +2761,10 @@ done:
 
 static const struct got_error *
 fetch_updated_remote(const char *proto, const char *host, const char *port,
-    const char *server_path, const char *jumphost, int verbosity,
-    const struct got_remote_repo *remote, struct got_repository *repo,
-    struct got_reference *head_ref, const char *head_refname)
+    const char *server_path, const char *jumphost, const char *identity_file,
+    int verbosity, const struct got_remote_repo *remote,
+    struct got_repository *repo, struct got_reference *head_ref,
+    const char *head_refname)
 {
 	const struct got_error *err = NULL, *unlock_err = NULL;
 	struct got_pathlist_entry *pe;
@@ -2787,7 +2788,7 @@ fetch_updated_remote(const char *proto, const char *ho
 		goto done;
 
 	err = got_fetch_connect(&fetchpid, &fetchfd, proto, host,
-	    port, server_path, jumphost, verbosity);
+	    port, server_path, jumphost, identity_file, verbosity);
 	if (err)
 		goto done;
 
@@ -2906,8 +2907,8 @@ got_worktree_cvg_commit(struct got_object_id **new_com
     got_worktree_commit_msg_cb commit_msg_cb, void *commit_arg,
     got_worktree_status_cb status_cb, void *status_arg,
     const char *proto, const char *host, const char *port,
-    const char *server_path, const char *jumphost, int verbosity,
-    const struct got_remote_repo *remote,
+    const char *server_path, const char *jumphost, const char *identity_file,
+    int verbosity, const struct got_remote_repo *remote,
     got_cancel_cb check_cancelled,
     struct got_repository *repo)
 {
@@ -3086,7 +3087,7 @@ got_worktree_cvg_commit(struct got_object_id **new_com
 
 	/* Attempt send to remote branch. */
 	err = got_send_connect(&sendpid, &sendfd, proto, host, port,
-	    server_path, jumphost, verbosity);
+	    server_path, jumphost, identity_file, verbosity);
 	if (err)
 		goto done;
 
@@ -3107,7 +3108,8 @@ got_worktree_cvg_commit(struct got_object_id **new_com
 		 * No trivial-rebase yet; require update to be run manually.
 		 */
 		err = fetch_updated_remote(proto, host, port, server_path,
-		    jumphost, verbosity, remote, repo, head_ref, head_refname);
+		    jumphost, identity_file, verbosity, remote, repo,
+		    head_ref, head_refname);
 		if (err == NULL)
 			goto done;
 		err = got_error(GOT_ERR_COMMIT_OUT_OF_DATE);