threads / patch / 14322

patch, 3 partsgit-imap-send: Allow the program to be run from subdirectories of a git tree.

Subject: [PATCH 1/3] git-imap-send: Allow the program to be run from subdirectories of a git tree.

## tl;dr

2 messages between Jul 7, 2008 and Jul 8, 2008. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Rob Shearman· Jul 7, 2008, 08:05 UTC · lore
Call setup_git_directory_gently to allow git-imap-send to be used from
subdirectories of a git tree.
---
 imap-send.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Show changes to imap-send.c +1 −0
diff --git a/imap-send.c b/imap-send.c
index 1ec1310..89a1532 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -1296,6 +1296,7 @@ main(int argc, char **argv)
 	/* init the random number generator */
 	arc4_init();

+	setup_git_directory_gently( NULL );
 	git_config(git_imap_config, NULL);

 	if (!imap_folder) {
-- 
1.5.6.GIT
Jeff King· Jul 8, 2008, 04:10 UTC · re: Rob Shearman · lore

Re: [PATCH 1/3] git-imap-send: Allow the program to be run from subdirectories of a git tree.

On Mon, Jul 07, 2008 at 09:05:22AM +0100, Rob Shearman wrote:
> Call setup_git_directory_gently to allow git-imap-send to be used from
> subdirectories of a git tree.
> [...]
> +	setup_git_directory_gently( NULL );

I don't think this is right; now we _must_ be in a git tree to run the command, which was not the case previously. You need to pass a non-NULL parameter to setup_git_directory_gently, which is where it will store the "are we in a git dir" return value (even if you don't want to look at it, if the parameter is NULL, it will die("not a git repository")).

-Peff

← back to recent threads