Commit f42d546c632d0458503efd01390bac76c185ebef

Ben Straub 2013-09-04T13:07:42

Provide better errors for push on non-bare local remotes

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/transports/local.c b/src/transports/local.c
index 8a75de7..9ebea97 100644
--- a/src/transports/local.c
+++ b/src/transports/local.c
@@ -361,7 +361,8 @@ static int local_push(
 	   non-bare repo push support would require checking configs to see if
 	   we should override the default 'don't let this happen' behavior */
 	if (!remote_repo->is_bare) {
-		error = -1;
+		error = GIT_EBAREREPO;
+		giterr_set(GITERR_INVALID, "Local push doesn't (yet) support pushing to non-bare repos.");
 		goto on_error;
 	}