diff --git a/git-context b/git-context index 92e2b81..1ec3dc4 100755 --- a/git-context +++ b/git-context @@ -9,6 +9,7 @@ Usage: git context [--depth N] [--files] [--log N] [--output file] [--dir 0 else None, + "branches": branches if branches else None, + "tree": tree_out, + } + if args.files: + out_dict["files"] = contents + output = json.dumps(out_dict, indent=2) + else: + output = "\n".join(sections) if args.output: - Path(args.output).write_text(output) + Path(args.output).write_text(output, encoding='utf-8') print(f"✅ Written to {args.output}") else: print(output)